I pass the index, and names of the IDs to find the other data to update. No matter what 'unique character' I have tried to split on, it gives me an error such as
illegal character
[Break on this error] var ad = addr.split(”?“);\n
Code: Select all
function populate(selectedIndex,numID,nameID,addrID,phoneID){
alert(selectedIndex+"\n"+numID+"\n"+nameID+"\n"+addrID+"\n"+phoneID);
document.getElementById(numID).value = numbers[selectedIndex];
document.getElementById(nameID).value = names[selectedIndex];
addr = address[selectedIndex];
var ad = addr.split(”?“);
var adOut = ad[0]."\n".ad[1]."\n".ad[2].", ".ad[3]."\n".ad[4];
document.getElementById(addrID).value = adOut;
document.getElementById(phoneID).value = phones[selectedIndex];
}
As a note, address is a textarea, so I am wanting to split and create newlines where required. If I did this before it was pushed into the array, I would get an unterminated string error.
Any ideas on what I am doing incorrectly, or a better solution for this problem?