Current location: Hot Scripts Forums » General Web Coding » JavaScript » Double-checking an e-mail address in a form


Double-checking an e-mail address in a form

Reply
  #1 (permalink)  
Old 09-04-03, 03:30 PM
Funky Monk Funky Monk is offline
New Member
 
Join Date: Aug 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Double-checking an e-mail address in a form

Hi,

I have a form on a web site. I want to be able to ask the user to re-enter their e-mail address and use Javascript to validate that the 2 addresses are the same.

I have so many users who mis-spell their e-mail addresses and consequently can't then contact them (it's for a mailing list). I've seen this on other sites but can't work out how to do it.

Thanks.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 09-04-03, 03:42 PM
BdSBB BdSBB is offline
Newbie Coder
 
Join Date: Jun 2003
Location: Georgetown, TX
Posts: 54
Thanks: 0
Thanked 0 Times in 0 Posts
Code:
function validate(f) {

   if (f.email.value != f.re_email.value) {
      alert('Your emails do not match!');
      return false;
   }
}

<form onsubmit="javascript:validate_email(this);">
<input name="email">
<input name="re_email">
... etc. ...
</form>
like this?
__________________
-- BdSBB
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 09-17-03, 11:11 PM
pat@barelyfitz.com pat@barelyfitz.com is offline
Newbie Coder
 
Join Date: Aug 2003
Location: Atlanta, GA, USA
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
other options

Also take a look at the following for a user-friendly addition for email address or password checking:

Verify / Notify for Duplicate Fields

Also keep in mind that the javascript might not work, so if you want to be extra sure that the two fields are the same, then you should check them in your back-end CGI.

In general, you should never rely on client-side processing to guarantee your data -- always check on the server where you have total control (but in this case, it might be overkill).
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
SQL database registration form help vinhkhuong PHP 3 10-10-03 04:49 AM
Help with feedback form sukino ASP 2 09-24-03 11:30 PM
Need Bravenet Alternative... bobby444 General HotScripts Site Discussion 10 07-17-03 10:36 PM
Error trapping x@x.xxx in form jonathen JavaScript 1 07-11-03 04:02 AM
Feedback form with double check plathw PHP 5 06-22-03 11:58 AM


All times are GMT -5. The time now is 09:18 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.