Copy-Paste from MS Excel fails with IE but works with Firefox
<p>I built a very simple app using a PHP form with a bit of Javascript.</p>

<p>In my form, I have a text input which I used to run a database search. In case I have multiple values, I have a bit of code that puts a comma in between each.</p>

<p>The weird part is this:</p>

<p>In Firefox, I can go do MS Excel, copy 5 values and paste them in the text input control. I can see all 5 values pasted and commas in between.</p>

<p>In Internet Explorer version 8, I can go do MS Excel, copy 5 values but only ONE value (the first number) gets pasted in the text input control.</p>

<p>This is my html </p>

<pre><code>&lt;fieldset&gt;
&lt;label for="DBRIDs"&gt;RIDs&lt;/label&gt;&lt;input type="text" id="DBRIDs" name="DBRIDs" onchange = "removespaces(this)"&gt;
&lt;/fieldset&gt;
</code></pre>

<p>This is my Javascript in my page header</p>

<pre><code>&lt;script language="javascript" type="text/javascript"&gt;
function removespaces(which) {
str = which.value;
str = str.replace (/\s|\n/g,",");  // replace space or newline by commas
document.myform.DBRIDs.value = str;
}
</code></pre>

<p>Pretty basic stuff. What am I missing? How come IE cannot paste like Firefox??</p>

<p><strong>EDIT</strong></p>

<p>I had a typo so using textarea is working now. I can copy a column and paste it from IE</p>

<p>Of course (sarcasm), it is introducing a new problem: It duplicates my commas and I am unclear it's because of textarea or my Javascript.</p>
