| | |
JavaScript -- Validating an email address
Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
As far as I know there is no way to see if an email is a valid one. (otherwise spammers would be in heaven). But there is a technique used to make sure somebody is using a real email. I dont know what your application is but lets say somebody is signing up to be a member on your site, or any sort of application. You will probably need to give them information after they hit submit. (username, password, receipt info....) any of these things you could display on the "confirmation page" but why do that. If they are using a fake email for whatever reason, you'll never know. Just send them their username, password etc. to their email. This keeps them honest. They must check their email to do anything else, therefore it must be valid
By the way, a lot of these things have nothing to do with JavaScript
By the way, a lot of these things have nothing to do with JavaScript
I agree having a confirmation process would be a good idea. Alot of sites will have the user click on a link in thier email before they are "offically confirmed". you can use java script however to make sure the user enters a properly formatted Email address.
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
<script> <!-- /*Email Check script credit-JavaScript Kit (www.javascriptkit.com) 200+ free JavaScripts here! */ function emailcheck(cur) { var string1=cur.email.value if (string1.indexOf("@")==-1) { alert("Please input a valid email address!") return false } } //--> </script> <form onsubmit="return emailcheck(this)"> <strong>Enter your email address please:</strong><br><input type="text" size="20" name="email"> <input type="submit" value="Submit!"> </form> <p align="center"><font face="arial" size="-2">This free script provided by</font><br> <font face="arial, helvetica" size="-2"><a href="http://javascriptkit.com">JavaScript Kit</a></font></p>
![]() |
Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: open link in opening window
- Next Thread: print datagrid
| Thread Tools | Search this Thread |
ajax ajaxcode ajaxexample ajaxhelp ajaxjspservlets animate automatically beta box browser bug captchaformproblem checkbox close codes createrange() css cursor debugger dependent disablefirebug dom download dropdown editor element engine enter error events explorer ext file firefox form forms frameworks getselection google gwt gxt hiddenvalue highlightedword hint html htmlform ie7 ie8 iframe internet java javascript javascripthelp2020 jawascriptruntimeerror jquery jsf jsfile jsp jump listbox maps masterpage math media menu microsoft mp4 object onmouseoutdivproblem onreadystatechange paypal pdf php player position problem programming progressbar prototype redirect regex runtime safari scale scriptlets search security select size software sql text textarea unicode w3c window windowofwords windowsxp wysiwyg \n






