Click to See Complete Forum and Search --> : javascript problem


nitin1311
June 15th, 2005, 02:53 PM
Hi,

I need help in javascript dynamic select.

Scenario is :

I need to select a "select1" option and then correspondingly the "select2" options should be displayed. This scenario is done but the issue is If I choose any option in "select2" and submit the form. the next time when I open the same form for the same entity to update. The selected item in " select2" is not set and it displayed the default item.

Any pointers to it is appreciated.


Regards,
Nitin

Dr. Script
June 15th, 2005, 09:03 PM
Possibly, in the onload event handler, delete all the options present in select2. Also, set the selectedIndex, when loading, of select1 to 0 (first item).

B-80
June 28th, 2005, 01:38 AM
why dont u make a cookie that holds the correct value?

Dr. Script
June 28th, 2005, 11:04 AM
That would work, but now re-reading it, I'm not sure which is intended:

- Onload, reset both select boxes
- Onload, set both select boxes to last selection