alena1347 Posted March 6, 2013 Share Posted March 6, 2013 Hello everyone, I have a problem i have to change the option values in the code given below and newOptions, newValues are also array's how could i assign different values in this function changeSelect(fieldID, newOptions, newValues) { selectField = document.getElementById(fieldID); selectField.options.length = 0; for (i=0; i<newOptions.length; i++) { selectField.options[selectField.length] = new Option(newOptions, newValues); } } Link to comment https://forums.phpfreaks.com/topic/275308-javascript-object-help/ Share on other sites More sharing options...
Adam Posted March 6, 2013 Share Posted March 6, 2013 Not sure I understand what you're asking here. You're passing the option names and values into the function? Link to comment https://forums.phpfreaks.com/topic/275308-javascript-object-help/#findComment-1417042 Share on other sites More sharing options...
alena1347 Posted March 7, 2013 Author Share Posted March 7, 2013 Not sure I understand what you're asking here. You're passing the option names and values into the function? Thank you this is solved i need to rename the values with another array and it will rename it. Link to comment https://forums.phpfreaks.com/topic/275308-javascript-object-help/#findComment-1417091 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.