Results 1 to 3 of 3

Thread: Start a new topic add your comments Email validation not working in Int. Explorer

  1. #1
    Join Date
    Jan 2007
    Posts
    23
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Start a new topic add your comments Email validation not working in Int. Explorer

    Hello,

    Can somebody help me? I don't understand why my script stops working in Internet Explorer if I include the following lines:
    =================================

    Code:
    var email = $("input#email").val();
    var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
    if (!filter(email)) {
    $("label#email_error").show();
    $("input#email").focus();
    return false;
    ================================

    It works fine with all other browsers.
    Thanks.

  2. #2
    Join Date
    Jun 2008
    Posts
    589
    Thanks
    13
    Thanked 54 Times in 54 Posts
    Blog Entries
    1

    Default

    Code:
    var email = $("input#email").val();
    var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
    if (!filter(email)) {
    $("label#email_error").show();
    $("input#email").focus();
    return false;
    }
    I suppose you just forgot to include the closing bracket in your example code. It's probably in your other code....

    Anyways, I'm not sure about this, but filter is not a function (don't know if it is, pretty sure it isn't), just RegEx stuff. I'm not exactly sure what should happen (it should filter, but how?), but it should work in IE if it works in all other browsers... Weird.

  3. #3
    Join Date
    Jan 2007
    Posts
    23
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    Thank you, magicyte.

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
  •