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 11 of 11
  1. #1
    New to the CF scene
    Join Date
    Oct 2002
    Location
    NJ
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post Email and form validation script

    Does anyone have a script that will validate required fields as well as a correct email format on a form?

    Thanks,
    Ralph

  • #2
    Senior Coder
    Join Date
    Aug 2002
    Posts
    3,467
    Thanks
    0
    Thanked 0 Times in 0 Posts
    My Site | fValidate | My Brainbench | MSDN | Gecko | xBrowser DOM | PHP | Ars | PVP
    “Minds are like parachutes. They don't work unless they are open”
    “Maturity is simply knowing when to not be immature”

  • #3
    Senior Coder
    Join Date
    Jun 2002
    Location
    ColoRockyz
    Posts
    1,649
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Look here.
    Zoobie or not Zoobie...That is the problem.
    <body onUnload="flush( ! )">

  • #4
    Senior Coder
    Join Date
    Aug 2002
    Posts
    3,467
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Originally posted by zoobie
    Look here.
    I'm #9 on that list...and climbing!
    My Site | fValidate | My Brainbench | MSDN | Gecko | xBrowser DOM | PHP | Ars | PVP
    “Minds are like parachutes. They don't work unless they are open”
    “Maturity is simply knowing when to not be immature”

  • #5
    New to the CF scene
    Join Date
    Oct 2002
    Location
    NJ
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Is there any more documentation on it other then the web site. Not too sure how it works.

    Ralph

  • #6
    Senior Coder
    Join Date
    Aug 2002
    Posts
    3,467
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I used to maintain a text-file (readme style) document, but between fValidate development, maintaining the website, plus developing my future projects, full-time job, my 2 year old...etc etc - keeping that text document current was impossible, and subsequently cut from my priority list.

    You can contact me directly with the contact form on the website

    I will give you any support you need, although I suggest you give the API a quick readthrough

    Cheers
    Last edited by beetle; 10-23-2002 at 08:01 PM.
    My Site | fValidate | My Brainbench | MSDN | Gecko | xBrowser DOM | PHP | Ars | PVP
    “Minds are like parachutes. They don't work unless they are open”
    “Maturity is simply knowing when to not be immature”

  • #7
    Senior Coder
    Join Date
    Jun 2002
    Location
    41° 8' 52" N -95° 53' 31" W
    Posts
    3,660
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You can't really validate an email address... unless you send an email to it and make sure it's answered.

    Beetle and I had a long discussion about this, and we agree.

    The best thing you can do is make sure that the user's email address at least matches a basic email regex, like:

    ^[\w\+\\'\.-]+@[\w\\'\.-]+\.[a-zA-Z]{2,}$

    And yeah, apparently + signs AND single quotes are allowed before the @ sign, and you can have a single quote after that (probably because of some screwy email provider)... it blew me away when a customer emailed us kinda ticked off because his email address was similar to:

    Bob+O'Reilly@some'server.co.uk

    wasn't valid according to usual email validating regular expressions ((the co.uk wasn't a problem...) and I originally stole the one above from perl, since I figured those guys had a lot of experience with them...).

    I've run into a lot of problems with trying to validate "valid" email addresses, I used to use jkd's regex, but that rejected a lot of valid email addresses.

    Besides, I can enter billgates@microsoft.com and it will match any regular expression available for valid email addresses. Your best bet is just to use validation to make sure noone has entered a really bad typo (or "asdf"), and they answer your email.
    Last edited by whammy; 10-24-2002 at 03:10 AM.
    Former ASP Forum Moderator - I'm back!

    If you can teach yourself how to learn, you can learn anything. ;)

  • #8
    Senior Coder
    Join Date
    Aug 2002
    Posts
    3,467
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hey Whammy...I remember our email validation discussion...something I'd like to share...

    After said discussion, I decided to look up the RFC specs to determine exactly what IS valid and what is not. After looking for about 30 minutes, I realized why nobody really knows what is valid. Trying to extract any useful meaning from those specs was roughly equivalent to me reading Mandarin Chinese. Upside-down. And drunk. Really...it is pure technical documentation, and I think, not designed to be usable by anyone, but exists merely just to exist.

    So, in short, the regex you've got is JUST fine
    My Site | fValidate | My Brainbench | MSDN | Gecko | xBrowser DOM | PHP | Ars | PVP
    “Minds are like parachutes. They don't work unless they are open”
    “Maturity is simply knowing when to not be immature”

  • #9
    Senior Coder
    Join Date
    Jun 2002
    Location
    41° 8' 52" N -95° 53' 31" W
    Posts
    3,660
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yeah, it's working ok. I know what you mean, since I did some research on it myself, and basically from what I gather (and I also felt like I was reading Mandarin Chinese while drunk and upside down) an email address theoretically allows anything in a valid *NIX filename... so really it depends on the provider, etc.

    Until I find out there are OTHER even STRANGER legal characters in an email address (which at this point wouldn't surprise me!), I'm sticking with that as well.

    The main advantage I have is I use the above regular expression for a customer service application I wrote, in which customers for several clients (that in total receive several MILLIONS of NON-SPAM (email newsletters) emails per month) will respond to the customer service department of the company. And if something doesn't work, the CS rep lets me know right away.

    So when there's a problem, I find out about it pretty quickly.
    Last edited by whammy; 10-25-2002 at 02:22 AM.
    Former ASP Forum Moderator - I'm back!

    If you can teach yourself how to learn, you can learn anything. ;)

  • #10
    Senior Coder
    Join Date
    Aug 2002
    Posts
    3,467
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Originally posted by beetle
    ...but exists merely just to exist.
    I can't believe missed an opportunity to use one of my favorite words: existential.
    My Site | fValidate | My Brainbench | MSDN | Gecko | xBrowser DOM | PHP | Ars | PVP
    “Minds are like parachutes. They don't work unless they are open”
    “Maturity is simply knowing when to not be immature”

  • #11
    New to the CF scene
    Join Date
    Oct 2002
    Location
    USA
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Talk about good timing. I just started learning about validation yesterday so this thread will help a lot.

    Posted a question about the url part today:
    http://www.codingforums.com/showthre...&threadid=8593
    which I think is close to being resolved.

    I considered making my script's email part work better, but then decided it's good enough for now. Figured as long as the user is allowed to leave it blank (for me it's optional) then they're less likely to enter a fake one.

    Reading what you wrote above *validates* my decision. (ha!)
    Thanks for all the help,
    Dean
    ~~~~~~~~~~~~~~~~~*
    bee 3,870


  •  

    Posting Permissions

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