I have a form in ASP.net that has a checkbox option to auto populate the form with the user infomation that is held in an table. When I select the checkbox the auto populate works well with texboxes in the form, but the auto populate does not work completely because a field in the form called shipcamp uses a dropdown list. How can I auto populate the camp field dropdown list as well using JavaScript? Thank you!
as you might see from the example above ... with the value attribute it should work ... and to be able to set the value values need to be present :) ... otherwise you would need to implement a logic that loops through the options and set the selected attribute which of course would be a possibility but even a bit of overhead ... basicly you should always have values for option nodes since this is much better to handle when you have special validation tasks or whatever ... if you would rely on text then you would need to have much more logic when it comes to multilanguage apps etc. since the text would be changing according to the languages while the values doesn't ...
as you might see from the example above ... with the value attribute it should work ... and to be able to set the value values need to be present :) ... otherwise you would need to implement a logic that loops through the options and set the selected attribute which of course would be a possibility but even a bit of overhead ... basicly you should always have values for option nodes since this is much better to handle when you have special validation tasks or whatever ... if you would rely on text then you would need to have much more logic when it comes to multilanguage apps etc. since the text would be changing according to the languages while the values doesn't ...