PreethaMIS
MIS
Hi,
I would like to disable the select box to start with. Based on the value of the textbox, I would like to enable it. Can we disable a Select Box? I have worked with disabling with textara and textbox, but the same approach is not working with select box.
I wish to disable the select box whenever the page loads. only if the value in the textbox starts with the number '19', then I wish to enable to select box.
Thanks.
I would like to disable the select box to start with. Based on the value of the textbox, I would like to enable it. Can we disable a Select Box? I have worked with disabling with textara and textbox, but the same approach is not working with select box.
Code:
<html>
<head>
<title>Check Text Box Value</title>
<script type="text/javascript">
function checkText()
{
obj = document.frmText.checkTxt
if (obj.value != "")
{
//enable the SendRepairOrdersto select box
document.frmText.SendRepairOrdersTo.enabled = true;
//document.frmText.SendRepairOrdersTo.style.background='#FFFFFF';
document.frmText.SendRepairOrdersTo.background='#FFFFFF';
}
else
{
//enable the SendRepairOrdersto select box
document.frmText.SendRepairOrdersTo.enabled = false;
document.frmText.SendRepairOrdersTo.background='#CCCCCC';
}
}
</script>
</head>
<body>
<form name="frmText" id="frmText">
Order Number<input type="text" name="checkTxt" id="checkTxt" onChange="checkText(this); this.form.EE.disabled=true;">
Send Email to:
<select name="SendRepairOrdersTo">
<option value="b.d@company.com">Brian Downward</option>
<option value="M.E@company.com">Maria Esquerra</option>
</select>
</form>
</body>
</html>
I wish to disable the select box whenever the page loads. only if the value in the textbox starts with the number '19', then I wish to enable to select box.
Thanks.