SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: fValidate

  1. #1
    SitePoint Member
    Join Date
    Jan 2004
    Location
    Spain
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    fValidate

    I am trying to get a copy of the fvalidate script to use to validate a registry form. I would like to know if this script has a way to disallow e-mails from certain domains (I am not interested in letting people register with "phony" domains... e.g. xx.com, aa.net, etc.). Can anyone help me with this? Is there a way to get this accomplished?
    Thanks for any help on the matter.

  2. #2
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,236
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    I don't think that is in fValidate, but you may be able to extend it somehow.

  3. #3
    SitePoint Member omnikey's Avatar
    Join Date
    Dec 2003
    Location
    Toledo
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I concur with Vinnie's previous post, you should be able to extend the validator for email to achieve the functionality you have described. The file "fValidate.validators.js" has the following section for email validation:

    /*< email web *******************************************************************/
    fValidate.prototype.email = function( level )
    {
    if ( this.typeMismatch( 'text' ) ) return;
    if ( typeof level == 'undefined' ) level = 0;
    var emailPatterns = [
    /.+@.+\..+$/i,
    /^\w.+@\w.+\.[a-z]+$/i,
    /^\w[-_a-z~.]+@\w[-_a-z~.]+\.[a-z]{2}[a-z]*$/i,
    /^\w[\w\d]+(\.[\w\d]+)*@\w[\w\d]+(\.[\w\d]+)*\.[a-z]{2,7}$/i
    ];
    if ( ! emailPatterns[level].test( this.elem.value ) )
    {
    this.throwError();
    }
    }
    /*/>*/





    This where I would start. Hope this helps.

    omnikey

  4. #4
    SitePoint Member
    Join Date
    Jan 2004
    Location
    Spain
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for your advice.... I will try to extend the code.


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
  •