Hello all,
I am just getting my feet wet with asp (I find it a lot of fun). This is what I am trying to do - I hope someone can give me a clue about how to do it.
When my page loads, the entire page is a form for the user to fill out for the application. certain fields in this form are prepopulated with retrieved data from the db. One of these formfields on the page is for "State". It is a dropdown list on which the options are hard-coded.
What I want to be able to do is indicate the retrieved State from the db on the dropdown list when the page loads. So far I have been able to write a javascript function that loops through the "options" array and does find a match with the value from the db (I have proven this with an alert box). I have tried setting
document.form[0].state.selected==true
but that didnt have the effect that I wanted (the dropdown box on the screen still says 'Choose a state...'). Is there a way to make the screen display the correct state?
Thanks a lot for your help - this is driving me nuts..
Bill
I am just getting my feet wet with asp (I find it a lot of fun). This is what I am trying to do - I hope someone can give me a clue about how to do it.
When my page loads, the entire page is a form for the user to fill out for the application. certain fields in this form are prepopulated with retrieved data from the db. One of these formfields on the page is for "State". It is a dropdown list on which the options are hard-coded.
What I want to be able to do is indicate the retrieved State from the db on the dropdown list when the page loads. So far I have been able to write a javascript function that loops through the "options" array and does find a match with the value from the db (I have proven this with an alert box). I have tried setting
document.form[0].state.selected==true
but that didnt have the effect that I wanted (the dropdown box on the screen still says 'Choose a state...'). Is there a way to make the screen display the correct state?
Thanks a lot for your help - this is driving me nuts..
Bill