Thread: Form Validation

    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2001
    Posts
    22
    Rep Power
    0

    Form Validation


    I'm using the following to validate that an entry has been made before sending form values using mailto. However, this sends the email whether the data is valid or not. This function is called form the onClick event of the Submit button - I must need to replace the 1st 'return' with another command?
    Any thoughts?
    thanks

    function validateIt()
    {
    var txtText
    txtText = document.request.company.value;
    if(txtText.length < 1) /
    {
    alert("Must enter a value");
    txtText.focus;
    return;
    }
    /* input ok */
    return;
    }
  2. #2
  3. Modding: Oracle MsSQL Firebird
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2001
    Location
    Outside US
    Posts
    8,527
    Rep Power
    539

IMN logo majestic logo threadwatch logo seochat tools logo