Urgent

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • MariaJC
    New Member
    • Feb 2007
    • 11

    Urgent

    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....
  • kenobewan
    Recognized Expert Specialist
    • Dec 2006
    • 4871

    #2
    Sounds like you need to use regular expressions:
    Regular Expressions in .NET

    Comment

    Working...