Javascript running improperly?

Posted by TruthStands on Stack Overflow See other posts from Stack Overflow or by TruthStands
Published on 2010-03-24T23:32:21Z Indexed on 2010/03/24 23:33 UTC
Read the original article Hit count: 119

Filed under:
|

I have a Javascript function that is called from the onchange method in a DropDownList. However I'm getting the error "Cannot have multiple items selected in a DropDownList." on line 14. This happens when the page is reloaded for other purposes. Why is it getting hung here when the method shouldn't even be getting called?

Line 12: {
Line 13:     var hfSelected = document.getElementById("<%=hfSelectedValue.ClientID%>");
Line 14:     var ddlExposure = document.getElementById("<%=ddlExposure.ClientID%>");
Line 15:     hfSelected.value = ddlExposure.options[ddlExposure.selectedIndex].text + "|" + ddlExposure.options[ddlExposure.selectedIndex].value;
Line 16: }

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about JavaScript