Hi, I want to diable form fields including some radio buttons on the selection of one radio button , I have found a javascript from net and tried to change it according to my requirement , but although after the slection of "No" from first radio it show the other fields disabled, but one can still enter value in them , how it can work ? In my form i need one radion dependining on othrt , that radio depending on another , and its like a chain , slecting a no will break the chain,
Please find teh code below and guide mr that how can i do that,
Thanks In Advance
<HTML>
<HEAD>
<SCRIPT>
function yes() {
MMDiv.style.color ='black';
mainform.MakeModel.disabled=false;
mainform.MakeModel.focus();
mainform.P.disabled=false;
mainform.P.focus();
mainform.PP.disabled=false;
mainform.PP.focus();
}
function yes1() {
MMDiv.style.color ='black';
mainform.p.disabled=false;
mainform.p.focus();
}
function no() {
MMDiv.style.color ='gray';
mainform.MakeModel.disabled=true;
mainform.MakeModel.value='';
mainform.p.disabled=true;
mainform.p.value='';
mainform.pp.disabled=true;
mainform.pp.value='';
}
function no1() {
MMDiv.style.color ='gray';
mainform.pp.disabled=true;
mainform.pp.value='';
}
</SCRIPT>
</HEAD>
<BODY>
<FORM NAME="mainform">
Allow Entry In all the fields Below
<INPUT TYPE="RADIO" NAME="PRINTER" onclick="yes();">
Don't Allow Entry in any of the fields below ( Also disable Radio button)
<INPUT TYPE="RADIO" NAME="PRINTER" onclick="no();" >
<p>
<BR>
</p>
<DIV ID="MMDiv" style="color:gray">
<LABEL FOR="MakeModel">
<INPUT TYPE="TEXT" ID="MakeModel" DISABLED size="20">
Make and Model</LABEL><p> </p>
<p> <INPUT TYPE="RADIO" NAME="P" onclick="yes1();">Allow Entry in radio
button below
<INPUT TYPE="RADIO" NAME="P" onclick="no1();" >Disable the radio buttons below
<p> <INPUT TYPE="RADIO" NAME="PP" >Yes
<INPUT TYPE="RADIO" NAME="PP" >No
</DIV>
<BR>
<INPUT TYPE="SUBMIT">
<INPUT TYPE="RESET">
</FORM>
</BODY>
</HTML>
Please find teh code below and guide mr that how can i do that,
Thanks In Advance
<HTML>
<HEAD>
<SCRIPT>
function yes() {
MMDiv.style.color ='black';
mainform.MakeModel.disabled=false;
mainform.MakeModel.focus();
mainform.P.disabled=false;
mainform.P.focus();
mainform.PP.disabled=false;
mainform.PP.focus();
}
function yes1() {
MMDiv.style.color ='black';
mainform.p.disabled=false;
mainform.p.focus();
}
function no() {
MMDiv.style.color ='gray';
mainform.MakeModel.disabled=true;
mainform.MakeModel.value='';
mainform.p.disabled=true;
mainform.p.value='';
mainform.pp.disabled=true;
mainform.pp.value='';
}
function no1() {
MMDiv.style.color ='gray';
mainform.pp.disabled=true;
mainform.pp.value='';
}
</SCRIPT>
</HEAD>
<BODY>
<FORM NAME="mainform">
Allow Entry In all the fields Below
<INPUT TYPE="RADIO" NAME="PRINTER" onclick="yes();">
Don't Allow Entry in any of the fields below ( Also disable Radio button)
<INPUT TYPE="RADIO" NAME="PRINTER" onclick="no();" >
<p>
<BR>
</p>
<DIV ID="MMDiv" style="color:gray">
<LABEL FOR="MakeModel">
<INPUT TYPE="TEXT" ID="MakeModel" DISABLED size="20">
Make and Model</LABEL><p> </p>
<p> <INPUT TYPE="RADIO" NAME="P" onclick="yes1();">Allow Entry in radio
button below
<INPUT TYPE="RADIO" NAME="P" onclick="no1();" >Disable the radio buttons below
<p> <INPUT TYPE="RADIO" NAME="PP" >Yes
<INPUT TYPE="RADIO" NAME="PP" >No
</DIV>
<BR>
<INPUT TYPE="SUBMIT">
<INPUT TYPE="RESET">
</FORM>
</BODY>
</HTML>