I built a very simple app using a PHP form with a bit of Javascript.
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.
The weird part is this:
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.
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.
This is my html
<fieldset>
<label for="DBRIDs">RIDs</label><input type="text" id="DBRIDs" name="DBRIDs" onchange = "removespaces(this)">
</fieldset>
This is my Javascript in my page header
<script language="javascript" type="text/javascript">
function removespaces(which) {
str = which.value;
str = str.replace (/\s|\n/g,","); // replace space or newline by commas
document.myform.DBRIDs.value = str;
}
Pretty basic stuff.
Tried changing textinput to textarea. No change. Am able to paste without problems from Firefox, Chrome, Safari and even Opera! IE is a no go.
What am I missing? How come IE cannot paste like Firefox?