Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Aug 2005
    Posts
    257
    Thanks
    8
    Thanked 0 Times in 0 Posts

    validate input text with predeterminate value

    I have an input text with value=Lois so I want to validate this input. If some user enter another word different of Lois will give an alert, and if in the field one writes the word Lois (without importing capital letters or minuscule) the form can be executed in correct form.

    Regards

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,147
    Thanks
    203
    Thanked 2,547 Times in 2,525 Posts
    I am not sure that I understand what is intended here,
    but

    function checkForLois(which) {
    var theName = which.value;
    if (theName != "Lois") {
    alert ("You must enter 'Lois' in this box to proceed");
    return false;
    }
    }

    onsubmit = "checkForLois(this)"


  •  

    Posting Permissions

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