1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134
|
<html>
<head>
<script type="text/JavaScript">
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_validateForm() { //v4.0
var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
for (i=0; i<(args.length-2); i+=3) {
test=args[i+2]; val=MM_findObj(args[i]);
if (val) {
nm=val.name;
if ((val=val.value)!="") {
if (test.indexOf('isEmail')!=-1) {
p=val.indexOf('@');
if (p<1 || p==(val.length-1)) errors+='- '+nm+' : ce champ doit contenir un e-mail\n';
} else if (test!='R') {
num = parseFloat(val);
if (isNaN(val)) errors+='- '+nm+' : ce champ doit contenir un code postal\n';
if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
min=test.substring(8,p); max=test.substring(p+1);
if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
}
}
}
else if (test.charAt(0) == 'R') errors += '- '+nm+' : ce champ doit être renseigné\n';
}
}
if (errors)
{
alert('Merci de compléter tous les champs obligatoires !\n\n'+errors);
return false;
}
else return true;
}
</script>
</head>
<body>
<form action="mailto:nom@email.com?subject=Titre de la demande" method="post" enctype="text/plain" name="abo"
onSubmit="return MM_validateForm('nom','','R','prenom','','R','societe','','R','fonction','','R','Code Postal','','RisNum','ville','','R','pays','','R','E-mail','','RisEmail','adresse','','R','activite','','R');alert('foo'); ">
<table width="520" cellspacing="1" border="0">
<tr>
<td colspan="2" align="center">
<p><input type="checkbox" name="En francais" value="oui"> En français
<input type="checkbox" name="En anglais" value="oui"> En anglais</p>
</td>
</tr>
<tr>
<td colspan="2">
<p> <input type="radio" value="M." checked name="civilite">M.
<input type="radio" value="Mme" name="civilite">Mme
<input type="radio" value="Mlle" name="mmm">Mlle</p>
</td>
</tr>
<tr height="30">
<td width="160" align="right"><p class="gras">Nom* </p></td>
<td width="360"><input type="text" name="nom" size="50"></td>
</tr>
<tr height="30">
<td align="right"><p class="gras">Prénom* </p></td>
<td ><input type="text" name="prenom" size="50"></td>
</tr>
<tr height="30">
<td align="right"><p class="gras">Société* </p></td>
<td><input type="text" name="societe" size="50"></td>
</tr>
<tr height="30">
<td align="right"><p class="gras">Fonction* </p></td>
<td><input type="text" name="fonction" size="50"></td>
</tr>
<tr height="30">
<td align="right" valign="top"><p class="gras">Adresse* </p></td>
<td><textarea rows="4" name="adresse" cols="45"></textarea></td>
</tr>
<tr height="30">
<td align="right"><p class="gras">Code postal* </p></td>
<td><input type="text" name="Code Postal" size="50"></td>
</tr>
<tr height="30">
<td align="right"><p class="gras">Ville* </p></td>
<td><input type="text" name="ville" size="50"></td>
</tr>
<tr height="30">
<td align="right"><p class="gras">Pays* </p></td>
<td><input type="text" name="pays" size="50"></td>
</tr>
<tr height="30">
<td align="right"><p class="gras">E-mail* </td>
<td><input type="text" name="E-mail" size="50"></td>
</tr>
<tr height="30">
<td align="right"><p class="gras">Tél. </td>
<td><input type="text" name="tel" size="50"></td>
</tr>
<tr height="30">
<td align="right" valign="top"><p class="gras">Domaine d'activité*</p></td>
<td><textarea rows="5" name="activite" cols="45"></textarea></td>
</tr>
<tr>
<td><p>* champs obligatoires</p></td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="submit" value="S'abonner" name="Envoyer" class="gras">
<input type="reset" value="Annuler" name="Annuler" class="gras"></td>
</tr>
</table>
</form>
</body>
</html> |
Partager