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); } } Quote 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? Quote Link to comment https://forums.phpfreaks.com/topic/275308-javascript-object-help/#findComment-1417042 Share on other sites More sharing options...
Solution alena1347 Posted March 7, 2013 Author Solution Share Posted March 7, 2013 (edited) 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. Edited March 7, 2013 by alena1347 Quote Link to comment https://forums.phpfreaks.com/topic/275308-javascript-object-help/#findComment-1417091 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.