Hello
I write a function in javascript for selecting a div when the user changes the input in radio button and dropdown menu
Myjavascript function is
function setState( abbrev )
{
if ( abbrev == "" || window.document.frm.selectdropdown.options.selecte dIndex == 0 )
{
parent.content.location.href = "corp_name_top.html" ;
} else
{
if (window.document.frm.nrr[0].checked == true)
{
parent.content.location.href = abbrev.toLowerCase() + ".html" ;
}
else
{
parent.content.location.href = abbrev.toLowerCase() + "_reg.html" ;
}
}
}
Sindex=0;
// This function determines the selected state and passes it to the setState function.
function changeState(selectedindex)
{
alert('hi');
Sindex = window.document.frm.selectdropdown.selectedIndex;
setState( window.document.frm.selectdropdown[Sindex].getattributes(value))
}
And my HTML code is
<p>An outline of requirements to reserve and protect a corporate name, by jurisdiction. Please select from the following options:</p>
<br />
<input type="radio" name="nrr" value="res" style="background : #cccccc; color: #000000;" onclick="setState(self.document.frm.Jurisdiction.o ptions[window.document.frm.Jurisdiction.selectedIndex].value)" checked="checked" />Reservation *
<input type="radio" name="nrr" value="reg" style="background : #cccccc; color: #000000;" onclick="setState(self.document.frm.Jurisdiction.o ptions[window.document.frm.Jurisdiction.selectedIndex].value)" />Registration<br />
<br />
<div class="contentBoxHeader">
<h3>Name Reservation & Registration</h3>
</div>
<select name="selectdropdown" onchange="changeState();">
<option value=" " selected="selected">Select a Jurisdiction:</option>
the error i got is window.document.form.selectdropdown is null or not an object
Please any one clarify what maistake i have made