Forum Moderators: phranque
Currently I'm using asp.net calendar control which is put in a pop-up window.
In the main page, user can fire that pop-up window and select the date and the date is supposed to write back to a dropdown list(as the selected value) which is in the main page.
If I use a textbox instead of the dropdown(select form) list, it works.
The following is part of the javascript I used:
strjscript += "window.opener." + HttpContext.Current.Request.QueryString["formname1"];
strjscript += ".value = '" + DateArray[0] + "'; window.close();";
strjscript += "</script" + ">";
The problem here, I guesss may be ".value" which works for a textbox, but not for dropdown list.(the selected value shows NULL in the dropdown list)
anyone can give me any suggestions is really appreciated
thanks in advance
feng zhu
to access the elements of a (dropdown)list in javascript is done by the following model:
list.options[0-n].property
where property is one of the following:
selected true/false, wether this entry is selected or not.
text the text of the entry
value the value of the entry
there are properties for the list directly, which might be usefull as well:
defaultSelected default seleted entry
length count of entries in the list
selectedIndex currently selected entry
so i hope this little description might help you.
-hakre