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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

radio button reset not working 1

Status
Not open for further replies.

ixnay5

MIS
Jan 10, 2002
68
US
hi -

i have a reset button with an onclickto reset some radio buttons. the radio buttons will not reset, but the other lines in the reset function definition execute correctly. what the heck am i doing wrong?

here's the html for the reset button:
Code:
<input type="button" name="fromresetbutton" value="Reset" onclick="frommyreset();"><br><br><br>

here's the function
Code:
function frommyreset(){
 
  //radio buttons
  document.mainform.fromrev.checked=false;
  document.mainform.frominter.checked=false;
  
  //control div display
  fromDS3Div.style.visibility='hidden';
  fromOC3Div.style.visibility='hidden';
  fromSTMDiv.style.visibility='hidden';
  fromVocSlaveDIV.style.visibility='hidden';
  
  //text box reset
  document.mainform.frompcount.value="";
  document.mainform.fromscount.value="";
	
  return true;

}

here's the html for the radio buttons:
Code:
<tr><td class="detail">	
Software Rev:&nbsp;&nbsp;<br>
A:&nbsp;<input type="radio" name="fromrev" value="A">&nbsp;&nbsp;&nbsp;
B:&nbsp;<input type="radio" name="fromrev" value="B">&nbsp;&nbsp;&nbsp;
</tr></td>
				
<tr><td class="detail">		
Interface:&nbsp;&nbsp;<br>
DS3:&nbsp;<input type="radio" name="frominter" value="DS3" onclick="fromDS3();">&nbsp;&nbsp;&nbsp;
OC3:&nbsp;<input type="radio" name="frominter" value="OC3" onclick="fromOC3();" disabled>&nbsp;&nbsp;&nbsp;
STM-1:&nbsp;<input type="radio" name="frominter" value="STM" onclick="fromSTM();" disabled>
</tr></td>


thanks a bunch,
eric
 
Try this?

[tt]
for (var i = 0; i < document.mainform.fromrev.length; i++) {
document.mainform.fromrev.checked = false;
}

for (var i = 0; i < document.mainform.frominter.length; i++) {
document.mainform.frominter.checked = false;
}
[/tt]

HTH.

*cLFlaVA
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top