Netlink2
asked on
Microsoft JScript runtime error: 'document.forms.0.cmbState.options' is null or not an object
Hi, the following code works in an aspx page when part of a <head>, but not when part of <asp:Content ID="Content1" ContentPlaceHolderID="Cont entPlaceHo lder1" Runat="Server">
var state = document.forms[0].cmbState .options[d ocument.fo rms[0].cmb State.sele ctedIndex] .text;
Can anyone help me with this ?.
Thanks in advance
var state = document.forms[0].cmbState
Can anyone help me with this ?.
Thanks in advance
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
OK, The code works (per your response) if I copy the code in to the aspx file itself. Any way I can get it running from a .js file ?.
ASKER
I get the error " Microsoft JScript runtime error: Object required ".
This could be because I'm running the Javascript from a .js file. Any further ideas ?.