Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Radio Button problem in Netscape

Status
Not open for further replies.

DKL01

Programmer
Sep 14, 2000
233
US
The following code works fine in IE and gives below mentioned error in Netscape Communicator 4.7.
Is there anything wrong with this code ?

Error - document.form1.option1 has no properties.


<script language=&quot;Javascript&quot;>

function save() {
document.form1.option1.checked = true;
}

</script>

<html>
<head> </head>
<body>

<form name=form1>
<input type=&quot;radio&quot; id=option1 name=option value=internal> <b>Internal</b>
<input type=&quot;radio&quot; id=option2 name=option value=external> <b>External</b>

<input type=&quot;button&quot; onclick=&quot;save()&quot;>
</form>

</body>
</html>

 
Instead of this:

document.form1.option1.checked = true;

DO this to check for the 1st radio button in your grouping

document.form1.option[0].checked = true
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top