Hello
I want to enable/disable a few asp.net controls on a form depending on whether the user has typed anything in a textbox. I thought i could check this using the onkeyup event like this:
In the asp.net page i have:
Obviously it doesnt work! What am i doing wrong?Should i add the onkeyup event as an attribute to the textbox in codebehind indtead?
I want to enable/disable a few asp.net controls on a form depending on whether the user has typed anything in a textbox. I thought i could check this using the onkeyup event like this:
Code:
function EnableRadioList()
{
var radiolist = document.getElementById('rdbRent');
var text = document.getElementById('txtRent').value;
if (text.length > 0)
{
radiolist.disabled = false;
}
else
{
radiolist.disabled = true;
}
}
In the asp.net page i have:
Code:
<script language="javascript" src="Javascripts\Global.js"></script>
.
.
.
<asp:textbox id="txtRent" onkeyup="EnableRadioList()" runat="server"></asp:textbox>
Obviously it doesnt work! What am i doing wrong?Should i add the onkeyup event as an attribute to the textbox in codebehind indtead?