radio butons enable and disable

J

joana

I wuold like to Know what I have to do, for a radio buton enable another grup
of them. If select the buton number 5 the next will be enable.

I have this code but only works if the radio buton (that stay disable or
enable) have diferent names and I need to have it with the same.

<body onload="document.myform.radio.disabled=true">
<form name="myform" action="#">
<input type=radio name="rad" onclick="this.form.radio.disabled=true;
this.form.radio.value='';">
<input type=radio name="rad" onclick="this.form.radio.disabled=true;
this.form.radio.value='';">
<input type=radio name="rad" onclick="this.form.radio.disabled=true;
this.form.radio.value='';">
<input type=radio name="rad" onclick="this.form.radio.disabled=true;
this.form.radio.value='';">
<input type=radio name="rad" onclick="this.form.radio.disabled=false;
this.form.radio.focus()">
<input type= "radio" name="radio" value="2">
<input type= "radio" name="radio" value="1">
<br>
</form>
</body>

Can someone help me?
 
S

Stefan B Rusynko

You need to enumerate the radio buttons (starting w/ 0 for 1st one)
As in
this.form.radio(0).disabled=true
this.form.radio(1).disabled=true

See http://www.yourhtmlsource.com/javascript/formvalidation.html
or http://javascript.internet.com/forms/field-show.html

--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
_____________________________________________


|I wuold like to Know what I have to do, for a radio buton enable another grup
| of them. If select the buton number 5 the next will be enable.
|
| I have this code but only works if the radio buton (that stay disable or
| enable) have diferent names and I need to have it with the same.
|
| <body onload="document.myform.radio.disabled=true">
| <form name="myform" action="#">
| <input type=radio name="rad" onclick="this.form.radio.disabled=true;
| this.form.radio.value='';">
| <input type=radio name="rad" onclick="this.form.radio.disabled=true;
| this.form.radio.value='';">
| <input type=radio name="rad" onclick="this.form.radio.disabled=true;
| this.form.radio.value='';">
| <input type=radio name="rad" onclick="this.form.radio.disabled=true;
| this.form.radio.value='';">
| <input type=radio name="rad" onclick="this.form.radio.disabled=false;
| this.form.radio.focus()">
| <input type= "radio" name="radio" value="2">
| <input type= "radio" name="radio" value="1">
| <br>
| </form>
| </body>
|
| Can someone help me?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top