Free Advertising Forums | Free Advertising Board | Post Free Ads Forum | Free Advertising Forums Directory | Best Free Advertising Methods | Advertising Forums

Free Advertising Forums | Free Advertising Board | Post Free Ads Forum | Free Advertising Forums Directory | Best Free Advertising Methods | Advertising Forums (http://www.freeadvertisingzone.com/index.php)
-   Safelist Directory (http://www.freeadvertisingzone.com/forumdisplay.php?f=61)
-   -   A JavaScript for verifying email address in a form | 太阳帆数据 ... (http://www.freeadvertisingzone.com/showthread.php?t=1665490)

08-27-2011 08:32 PM

A JavaScript for verifying email address in a form | 太阳帆数据 ...
 
A JavaScript for verifying email address in a form By Zhanshan Dong on August 25th, 2011 To get a valid email address in a web form, you have to make sure that users enter a valid email address. <a href="http://www.nfljerseys-supply.com/"><strong>NFL jersey supply</strong></a> One way to that is using a javascript to do it. After users enter an email address, use javascript to verify it right way. If the email is valid, move to the next field. <a href="http://www.nfljerseys-supply.com/"><strong>NHL jerseys supply</strong></a> Otherwise, popup an alert dialog and highlight the email input box. Allow users to modify their inputs. Here is a simply JavaScript code. function verifyEmail(formname, email) { var emailRegEx = /^[A-Z0-9._%+-]+@[A-Z0-9.-]+.[A-Z]{2,4}/i; if (email.search(emailRegEx) == -1) { alert("请输入一个有效的电*邮件地址. "); var <a href="http://www.nfljerseys-supply.com/"><strong>NHL jerseys</strong></a> myform = window.document.forms[formname]; myform.elements["email"].focus(); } }


All times are GMT. The time now is 05:43 AM.

Powered by vBulletin Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Free Advertising Forums | Free Advertising Message Boards | Post Free Ads Forum