I dit sidste eksempel validerer du ikke på e-mail-adressen; den har jeg nu tilføjet, så den ser nu sådan ud hos mig (og altså med validering i felterne "navn", "adresse", "postnr", "telefonnr" samt "e-mail-adresse"):
<html>
<head>
<title>dbsyn.dk/kontakt os</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<SCRIPT Language="JavaScript">
<!--
function Control() {
if(document.form.navn.value == "") {
alert("Du skal indtaste et navn.");
document.form.navn.focus();
return false;
}
if(document.form.adresse.value == "") {
alert("Du skal indtaste en adresse.");
document.form.adresse.focus();
return false;
}
if(document.form.post.value == "") {
alert("Du skal indtaste et postnummer og tilhørende by.");
document.form.post.focus();
return false;
}
if(document.form.tlf.value == "") {
alert("Du skal indtaste et telefonnummer.");
document.form.tlf.focus();
return false;
}
if(isNaN(document.form.tlf.value)) {
alert("Det indtastede telefonnummer må kun indeholde tal.");
document.form.tlf.focus();
document.form.tlf.select();
return false;
}
var t = "\\wáàãââæåçéèêëìíîïñòóôõöøùúûüýÿ";
var regexp = new RegExp("^["+t+"]["+t+"\\.\\-]*@["+t+"]["+t+"\\.\\-]*\\.["+t+"]{2}["+t+"\\.\\-\\/]*$","i");
if (!regexp.test(document.form.mail.value)){
alert ("Der skal stå en gyldig e-mail adresse");
document.form.mail.select();
document.form.mail.focus();
return false;
}
return true;
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_nbGroup(event, grpName) { //v6.0
var i,img,nbArr,args=MM_nbGroup.arguments;
if (event == "init" && args.length > 2) {
if ((img = MM_findObj(args[2])) != null && !img.MM_init) {
img.MM_init = true; img.MM_up = args[3]; img.MM_dn = img.src;
if ((nbArr = document[grpName]) == null) nbArr = document[grpName] = new Array();
nbArr[nbArr.length] = img;
for (i=4; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
if (!img.MM_up) img.MM_up = img.src;
img.src = img.MM_dn = args[i+1];
nbArr[nbArr.length] = img;
} }
} else if (event == "over") {
document.MM_nbOver = nbArr = new Array();
for (i=1; i < args.length-1; i+=3) if ((img = MM_findObj(args[i])) != null) {
if (!img.MM_up) img.MM_up = img.src;
img.src = (img.MM_dn && args[i+2]) ? args[i+2] : ((args[i+1])? args[i+1] : img.MM_up);
nbArr[nbArr.length] = img;
}
} else if (event == "out" ) {
for (i=0; i < document.MM_nbOver.length; i++) {
img = document.MM_nbOver[i]; img.src = (img.MM_dn) ? img.MM_dn : img.MM_up; }
} else if (event == "down") {
nbArr = document[grpName];
if (nbArr)
for (i=0; i < nbArr.length; i++) { img=nbArr[i]; img.src = img.MM_up; img.MM_dn = 0; }
document[grpName] = nbArr = new Array();
for (i=2; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
if (!img.MM_up) img.MM_up = img.src;
img.src = img.MM_dn = (args[i+1])? args[i+1] : img.MM_up;
nbArr[nbArr.length] = img;
} }
}
//-->
</script>
<link href="typografier.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="#333333" link="#FFFFFF" vlink="#CCCCCC" alink="#CCCCCC" onLoad="MM_preloadImages('links/link_tilstandsrapporter_fed.gif','links/link_energimaerker_fed.gif','links/link_bygherre_fed.gif','links/link_projektering_fed.gif','links/link_vedligeholdelse_fed.gif','links/link_nyt_adresser_fed.gif','links/velkommen_fed.gif');">
<table width="700" height="576" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#FFFFFF" bgcolor="#FFFFFF">
<tr>
<td height="63" colspan="5" bgcolor="#FFFFFF"><img src="billeder/logo.gif" width="260" height="65" border="0" usemap="#Map">
<map name="Map">
<area shape="rect" coords="2,1,258,64" href="index.html" alt="Til forsiden">
</map></td>
<td height="63" colspan="4" align="right" bgcolor="#FFFFFF"> </td>
</tr>
<tr>
<td height="21" bordercolor="#1D0272" bgcolor="#1D0272"> </td>
<td bordercolor="#1D0272" bgcolor="#1D0272"> </td>
<td height="21" bordercolor="#1D0272" bgcolor="#1D0272"> </td>
<td bordercolor="#1D0272" bgcolor="#1D0272"> </td>
<td height="21" valign="middle" bordercolor="#1D0272" bgcolor="#1D0272" class="linktekst"><a href="om_os.html">Om
Dansk Bygningssyn</a></td>
<td valign="middle" bordercolor="#1D0272" bgcolor="#1D0272" class="linktekst"><a href="referencer.html">Referencer</a></td>
<td valign="middle" bordercolor="#1D0272" bgcolor="#1D0272"><font color="#FFFFFF" size="1" face="Verdana, Arial, Helvetica, sans-serif">K</font><span class="linktekst"><a href="kontakt_os.html">Kontakt
os</a> </span><img src="billeder/konvolut.gif" width="26" height="13" align="absbottom"></td>
<td height="21" colspan="2" valign="middle" bordercolor="#1D0272" bgcolor="#1D0272"><span class="linktekst"><a href="sitemap.html">Sitemap</a></span><img src="billeder/sitemap_logo.gif" width="22" height="14" align="absbottom"></td>
</tr>
<tr>
<td width="191" height="10"></td>
<td width="1"></td>
<td></td>
</tr>
<tr>
<td height="455" colspan="2" valign="top" bordercolor="1d0272" background="billeder/baggrund_links.gif"><table border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="194"><a href="index.html" target="_top" onClick="MM_nbGroup('down','group1','Velkommen','links/velkommen_fed.gif',1)" onMouseOver="MM_nbGroup('over','Velkommen','links/velkommen_fed.gif','links/velkommen_fed.gif',1)" onMouseOut="MM_nbGroup('out')"><img name="Velkommen" src="links/velkommen_nor.gif" border="0" alt="Til forsiden" onLoad=""></a></td>
</tr>
<tr>
<td><a href="tilstandsrapporter.html" target="_top" onClick="MM_nbGroup('down','group1','tilstandsrapporter','links/link_tilstandsrapporter_fed.gif',1)" onMouseOver="MM_nbGroup('over','tilstandsrapporter','links/link_tilstandsrapporter_fed.gif','links/link_tilstandsrapporter_fed.gif',1)" onMouseOut="MM_nbGroup('out')"></a><a href="tilstandsrapporter.html" target="_top" onClick="MM_nbGroup('down','group1','tilstandsrapporter','links/link_tilstandsrapporter_fed.gif',1)" onMouseOver="MM_nbGroup('over','tilstandsrapporter','links/link_tilstandsrapporter_fed.gif','links/link_tilstandsrapporter_fed.gif',1)" onMouseOut="MM_nbGroup('out')"><img src="links/link_tilstandsrapporter_nor.gif" alt="Tilstandsrapporter" name="tilstandsrapporter" border="0" onload=""></a></td>
</tr>
<tr>
<td><a href="energimaerker.html" target="_top" onClick="MM_nbGroup('down','group1','Energimaerker','links/link_energimaerker_fed.gif',1)" onMouseOver="MM_nbGroup('over','Energimaerker','links/link_energimaerker_fed.gif','links/link_energimaerker_fed.gif',1)" onMouseOut="MM_nbGroup('out')"><img src="links/link_energimaerker_nor.gif" alt="Energimærker" name="Energimaerker" width="193" height="22" border="0" onload=""></a></td>
</tr>
<tr>
<td><a href="bygherreraadgivning.html" target="_top" onClick="MM_nbGroup('down','group1','Bygherreraadgivning','links/link_bygherre_fed.gif',1)" onMouseOver="MM_nbGroup('over','Bygherreraadgivning','links/link_bygherre_fed.gif','links/link_bygherre_fed.gif',1)" onMouseOut="MM_nbGroup('out')"><img src="links/link_bygherre_nor.gif" alt="Bygherrerådgivning" name="Bygherreraadgivning" width="193" height="22" border="0" onload=""></a></td>
</tr>
<tr>
<td><a href="projektering.html" target="_top" onClick="MM_nbGroup('down','group1','Projektering','links/link_projektering_fed.gif',1)" onMouseOver="MM_nbGroup('over','Projektering','links/link_projektering_fed.gif','links/link_projektering_fed.gif',1)" onMouseOut="MM_nbGroup('out')"><img src="links/link_projektering_nor.gif" alt="Projektering/byggeledelse" name="Projektering" width="193" height="22" border="0" onload=""></a></td>
</tr>
<tr>
<td><a href="vedligeholdelsesplaner.html" target="_top" onClick="MM_nbGroup('down','group1','Vedligeholdelsesplaner','links/link_vedligeholdelse_fed.gif',1)" onMouseOver="MM_nbGroup('over','Vedligeholdelsesplaner','links/link_vedligeholdelse_fed.gif','links/link_vedligeholdelse_fed.gif',1)" onMouseOut="MM_nbGroup('out')"><img src="links/link_vedligeholdelse_nor.gif" alt="Vedligeholdelsesplaner" name="Vedligeholdelsesplaner" width="193" height="22" border="0" onload=""></a></td>
</tr>
<tr>
<td><a href="nyttige_adresser.html" target="_top" onClick="MM_nbGroup('down','group1','adresser','links/link_nyt_adresser_fed.gif',1)" onMouseOver="MM_nbGroup('over','adresser','links/link_nyt_adresser_fed.gif','links/link_nyt_adresser_fed.gif',1)" onMouseOut="MM_nbGroup('out')"><img src="links/link_nyt_adresser_nor.gif" alt="Links og nyttige adresser" name="adresser" width="193" height="22" border="0" onload=""></a></td>
</tr>
</table></td>
<td width="1" valign="top" bgcolor="#FFFFFF"> </td>
<td width="417" colspan="6" valign="top" bordercolor="1d0272" bgcolor="e1e0e4"><br>
<span class="overskrift">Kontakt os</span><span class="broedtekst">
(Bestillingsseddel)<br>
<br>
</span> <form action="
http://www.xxxxxx.dk/mailengine.php" method="post" name="form" onSubmit="return Control(this.form);">
<input type="hidden" name="post_sender" value="
www.xxxx.dk"> <input type="hidden" name="post_receiver" value="info@xxxx.dk">
<input type="hidden" name="post_subject" value="Mail fra hjemmesiden">
<input type="hidden" name="post_onerror" value="
http://www.dbsyn.dk/faliure.html"> <input type="hidden" name="post_onsucces" value="
http://www.dbsyn.dk/thanks.html"> <table width="93%" border="0" align="center" cellpadding="2" bordercolorlight="#C0C0C0" bgcolor="#FFFFFF" class="SurveyOptions">
<tr>
<td class="broedtekst">Navn: </td>
<td bgcolor="#CCCCCC" class="broedtekst"> <input type="text" size="45" name="navn">
*</td>
</tr>
<tr>
<td valign="top" class="broedtekst">Adresse: </td>
<td valign="top" bgcolor="#CCCCCC" class="broedtekst">
<p><input type="text" size="45" name="adresse">
*</p>
</td>
</tr>
<tr>
<td class="broedtekst">Postnr: </td>
<td bgcolor="#CCCCCC" class="broedtekst">
<p><input type="text" size="10" maxlength="10"
name="post">
<span class="broedtekst"> * By: </span>
<input type="text" size="24" name="by">
</p>
</td>
</tr>
<tr>
<td class="broedtekst">Telefon: </td>
<td bgcolor="#CCCCCC" class="broedtekst">
<p><input type="text"
size="12" name="tlf"> *</p>
</td>
</tr>
<tr>
<td height="26" class="broedtekst">Email</td>
<td bgcolor="#C0C0C0" class="broedtekst"> <input type="text" name="mail" size="40">
* </tr>
</table>
<p class="broedtekst"> De med * markede felter skal udfyldes</p>
<p class="broedtekst"><strong> JA tak</strong>, jeg vil gerne kontaktes
vedrørende: </p>
<table width="90%" border="0" align="center" bgcolor="#FFFFFF" class="SurveyOptions">
<tr>
<td bgcolor="#C0C0C0"><input type="checkbox"
name="tilstandsrapporter" value="ON"></td>
<td class="broedtekst"> tilstandsrapporter</td>
</tr>
<tr>
<td width="34" bgcolor="#C0C0C0"><input type="checkbox"
name="energimærker" value="ON"> </td>
<td width="375" class="broedtekst"> energimærker</td>
</tr>
<tr>
<td bgcolor="#C0C0C0"><input type="checkbox"
name="vedligeholdelsesplaner" value="ON"></td>
<td class="broedtekst"> vedligeholdelsesplaner</td>
</tr>
<tr>
<td bgcolor="#C0C0C0"><input type="checkbox"
name="bygherrerådgivning" value="ON"></td>
<td class="broedtekst">bygherrerådgivning</td>
</tr>
<tr>
<td width="34" bgcolor="#C0C0C0"><input type="checkbox"
name="projektering/byggeledelse" value="ON"> </td>
<td width="375" class="broedtekst">projektering/byggeledelse </td>
</tr>
<tr>
<td height="24" bgcolor="#C0C0C0"> <input type="checkbox" name="opringes"
value="ON"></td>
<td><span class="broedtekst">ringes op af en konsulent på telefonnr.</span>
<input
type="text" name="opringringsnr" size="10"></td>
</tr>
</table>
<div align="left">
<p> </p>
<p align="center"><span class="broedtekst">Evt. kommentarer:</span><br>
<textarea name="brevtekst" cols="40" rows="6"></textarea>
</p>
</div>
<div align="center">
<center>
<p> </p>
</center>
</div>
<div align="left">
<p align="center">
<input name="submit" type="submit" value="Send skema">
<input name="reset" type="reset" value="Slet skema">
</p>
</div>
</form></td>
</tr>
<tr>
<td height="21" colspan="8" bgcolor="#FFFFFF"> </td>
<td width="81" bgcolor="#FFFFFF"> </td>
</tr>
</table>
</body>
</html>