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 3 of 3
  1. #1
    New Coder
    Join Date
    Jul 2005
    Posts
    83
    Thanks
    0
    Thanked 0 Times in 0 Posts

    check if input type="text" has a symbol

    so i have regular input field.
    how can i check if use inputs an apostrophe there?
    so that if they do, i would alert("them") ?
    i hope someone can help.
    thanks.

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,908
    Thanks
    203
    Thanked 2,531 Times in 2,509 Posts
    if (/\'/g.test(thefieldName.value)) {
    alert ("You have typed an apostrophe!")
    }

  • #3
    New Coder
    Join Date
    Jul 2005
    Posts
    83
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Philip M
    if (/\'/g.test(thefieldName.value)) {
    alert ("You have typed an apostrophe!")
    }
    Thank you so much!!!


  •  

    Posting Permissions

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