I'm stupid

Results 1 to 2 of 2

Thread: I'm stupid

  1. #1
    Join Date
    Dec 1969

    Default I'm stupid

    I&#039;ve looked round and looked at the FAQ&#039;s - this is the 1st time I&#039;ve had to use regExp other than email validation, I&#039;d just like to know how i can make my page check a string has the allowed characters and if it doesnt tell the person they can only use regular characters kinda thing...<BR><BR>I want to use only 0-9 a-z A-z _ - [] and a space

  2. #2
    Join Date
    Dec 1969

    Default RE: I'm stupid

    &nbsp;<BR>myString = myForm.myTextbox.value;<BR>var re = new RegExp("[-wd[] ]+");<BR><BR>if (re.test(myString) == false)<BR>&nbsp;&nbsp;&nbsp;alert("Invalid input")<BR><BR>

Posting Permissions

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