Hi,
I am trying to design a site using asp.net/C#.
I have a text field to enter only numbers.
What i want is, the user should not be allowed to proceed until he fills the field and the field needs to be checked for numbers alone as soon as it loses focus
I am trying to call a javascript function. But i cannot call on key press in asp.net.
How can i check this
script function is :
function CheckValue()
{
if (isNaN(document .getElementById ("txtNumber" ))
{
alert("Please enter numeric values only.");
document.getEle mentById("txtNu mber").value = '';
return false;
}
}
Please help....
I am trying to design a site using asp.net/C#.
I have a text field to enter only numbers.
What i want is, the user should not be allowed to proceed until he fills the field and the field needs to be checked for numbers alone as soon as it loses focus
I am trying to call a javascript function. But i cannot call on key press in asp.net.
How can i check this
script function is :
function CheckValue()
{
if (isNaN(document .getElementById ("txtNumber" ))
{
alert("Please enter numeric values only.");
document.getEle mentById("txtNu mber").value = '';
return false;
}
}
Please help....
Comment