dvs. man kan bruge? if(!theForm.email.match(/^[\w]{1}[\w\.\-_]*@[\w]{1}[\w\-_\.]*\.[\w]{2,6}$/i)) { alert ('Din Email er ikke korrekt'); } else { return true; }
For en god ordens skyld bør du lige bibeholde hans disclaimer...
<script language="JavaScript1.2" type="text/javascript"> <!-- /* File : verifyemail.js Version : 1.1 Date : 3rd april 2002 Author : Lars B. Jensen, lars.jensen@ljweb.biz
Module Description JavaScript function to check the validity of an email address.
Instruction The function verifyemail_check will return a boolean upon verifying the valid formatting of an email address. The actual email is not checked if exists, only for correct formatting.
Example 1 : Verify single email if (!verifyemail_check('lars.jensen@ljweb.biz')) { alert("Email not valid !"); }
Example 2 : Verify name and email before allowing form to submit into popup (newsletter application) function signnewsletter(name, email) { if (!name.length > 0) { alert("You forgot to type in your name !"); document.newsletterform.name.focus(); return false; }
if (!verifyemail_check(email)) { alert("Email verification failed, please verify your email !"); document.newsletterform.email.focus(); return false; }
og den kan også se sådan ud: if(!theForm.Email.match(/^[\w]{1}[\w\.\-_]*@[\w]{1}[\w\-_\.]*\.[\w]{2,6}$/i)) { alert ('Din Email er ikke korrekt'); theForm.email.focus(); } else { return true; }
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.