Results 1 to 2 of 2

Thread: Validation Script & Error Message Help

  1. #1
    Join Date
    Jun 2008
    Posts
    13
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Validation Script & Error Message Help

    The inputs to the form below is supposed to be validated using the script below. If the user does not use all numbers, a message is supposed to appear next to the "validate" button saying "The input is not numeric." Can someone help me on this?

    // <form id="form1" name="form1" action="#">
    // <table align='center'>
    /* <td><input name="numeric" id="numeric" validation="required" /><input type="submit" value=" Validate " onclick="IsNumeric();" /></td> */
    // </table>
    // </form>

    // <script type="text/javascript">
    // function IsNumeric(sText) {
    // var ValidChars = "0123456789.";
    // var IsNumber=true;
    // var Char;
    // for (i=0;i<sText.length && IsNumber == true; i++) {
    // Char = sText.charAt(i);
    // if (ValidChars.indexOf(Char) == -1) {
    // IsNumber = false;
    // }
    // }
    // return IsNumber;
    // }
    // </script>

  2. #2
    Join Date
    Jun 2008
    Posts
    13
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    Solved my problem.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •