I have a form with a dropdownlist and 4 input text fields. I need to set these 4 input text field values according to the dropdown list selected.
The problem now is these 4 input text fields values will only be updated for the first time the dropdown is changed. For the subsequent ajax calls, these input text fields will never be changed, although I can see the backend ajax function does be executed.
I would do everything in javascript: when the dropdown is changed JS makes the ajax request and when it gets the answer it sets a variable to remember that it shouldn’t update the dropdown again, something like “alreadyDone = true”.
Still I think it’s not a good idea to allow to do something only one time: what if the user makes a mistake and chooses the wrong option? he should reload the page to make another choice…
Hi all, thanks for your input. Sorry for my late reply since was quite busy with other stuffs.
bettor,
I can see there is different set of values returned by the loadPubConfig function call. I noticed a problem that the form data in the response header (i use chrome -> network to debug) was not changed, but the content for this function call was changed accordingly and it looks correct. But it was not populated to the input fields as wanted.
mukesh,
I need to retrieve the values pre-configured for each options in the dropdown list from db. For example, admin name for option 1 in dropdown is "A", admin name for option 2 in dropdown is "B".