Search HouseOfScripts.com

 

All Scripts        JavaScripts        ASP Scripts        Other Scripts

 

  Disable buttons according to the selected radio button asp, send, email, cdonts, link, recordset, hyper, hyperlink, create, list, box, dependant, dynamic

I needed to create the page where some of the radio buttons would be disabled, based on selection of the main radio buttons. The only usefull script was: How can I make buttons enabled/disabled according to the selected radio button. That was not what I needed. Based on this script, I created script where I had disabled/enabled radio buttons groups according to the selected radio button. Click here and you will see the code. I also have codes to enable/disable buttons based on Menu Selection of based on Checkbox.

Enabled/disabled Buttons according to the selected radio button

option 1 option 2

<HTML>
< HEAD>

<SCRIPT LANGUAGE="JavaScript">

function Disab(val) {
frm=document.forms[0]

if(val=="option 1")
{frm.Button2.disabled=true;frm.Button1.disabled=false}

else {frm.Button1.disabled=true;frm.Button2.disabled=false}

}

</SCRIPT>

</HEAD>
<BODY TEXT="000000" BGCOLOR="FFFFFF">

<FORM>

<INPUT TYPE=radio NAME="f1" VALUE="option 1" onClick="Disab(this.value)">option 1
<INPUT TYPE=radio NAME="f1" VALUE="option 2" onClick="Disab(this.value)">option 2
<P>
<INPUT TYPE=button onClick="alert('Button 1 pressed!')" VALUE="Button
1" NAME="Button1">
<INPUT TYPE=button onClick="alert('Button 2 pressed!')" VALUE="Button
2" NAME="Button2">

</FORM>
</BODY>
</HTML>

 

 


Home       Scripts       Active WebTools       Web Templates       Forum       Tools        Hosting       Questions/Comments       Add/Request