Search HouseOfScripts.com

 

All Scripts        JavaScripts        ASP Scripts        Other Scripts

 

  Enable/Disable buttons according to the menu selection asp, send, email, cdonts, link, recordset, hyper, hyperlink, create, list, box, dependant, dynamic

One of the requests that we received was how disable button based on selection of the menu. Here is the script.

Click here if you are looking for a scripts how to disabled/enabled radio buttons groups according to the Selected Radio Button. I also have codes to enable/disable buttons based on Checkbox.

Enable/Disable Buttons according to the menu selection

<HTML>
< HEAD>

<SCRIPT LANGUAGE="JavaScript">

function Disab(val) {
frm=document.forms[0]
if(val=="enabl")
{frm.Button1.disabled=false;frm.Button2.disabled=false}
if(val=="buttn1")
{frm.Button1.disabled=true;frm.Button2.disabled=false}
if(val=="buttn2")
{frm.Button1.disabled=false;frm.Button2.disabled=true}
if(val=="disabl")
{frm.Button1.disabled=true;frm.Button2.disabled=true}
}

</SCRIPT>

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

<form>
<div align="center">
<select name="select" onChange="Disab(this.value)">
<option value="enabl">Enable All Buttons</option>
<option value="buttn1">Disable Button 1</option>
<option value="buttn2">Disable Button 2</option>
<option value="disabl">Disable All Buttons</option>
</select>
</div>
<p align="center">
<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