Salut,
Je débute comme vous allez le voir (!) et j'ai bien cherché mais je ne trouve pas comment rediriger le visiteur sur une autre page une fois qu'il a rempli mon formulaire... pour qu'il constate que tout a fonctionné.

J'ai bien fait en sorte que les champs soient testés et que ça me soit envoyé par mail quand on clique sur SUBMIT, ça fonctionne. Mais pour l'instant, pas de feedback pour le visiteur...

Je pense à une instruction du type : window.location="newpage.asp";

Mais où et comment l'intégrer au script ?

SVP aidez-moi... je sèche ! [/B]
PS : je précise que je n'ai pas mis d'instructions sur le bouton "submit" pour que l'envoi du form par mail fonctionne même si l'utilisateur a désactivé javascript...

Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
 
<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);
  document.MM_returnValue = (errors == '');
  }  
  }
 
</script>
</head>
 
 
<body>
 
<form action="mailto:nom@email.com?subject=Titre de la demande" method="post" enctype="text/plain" name="abo" 
onSubmit="MM_validateForm('nom','','R','prenom','','R','societe','','R','fonction','','R','Code Postal','','RisNum','ville','','R','pays','','R','E-mail','','RisEmail','adresse','','R','activite','','R'); return document.MM_returnValue; ">
  <table width="520" cellspacing="1" border="0">
    <tr>
      <td colspan="2" align="center">
      		<p><input type="checkbox" name="En francais" value="oui"> En fran&ccedil;ais
      			&nbsp;&nbsp;&nbsp;&nbsp;
      			<input type="checkbox" name="En anglais" value="oui"> En anglais</p>
      	</td>
    </tr>
    <tr>
      <td colspan="2">
        <p>&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" value="M." checked name="civilite">M.&nbsp;&nbsp;&nbsp;&nbsp;
        	<input type="radio" value="Mme" name="civilite">Mme&nbsp;&nbsp;&nbsp;&nbsp; 
        	<input type="radio" value="Mlle" name="mmm">Mlle</p>
		</td>
    </tr>
    <tr height="30">
      <td width="160" align="right"><p class="gras">Nom*&nbsp;</p></td>
      <td width="360"><input type="text" name="nom" size="50"></td>
    </tr>
    <tr height="30">
      <td align="right"><p class="gras">Pr&eacute;nom*&nbsp;</p></td>
      <td ><input type="text" name="prenom" size="50"></td>
    </tr>
 
    <tr height="30">
      <td align="right"><p class="gras">Soci&eacute;t&eacute;*&nbsp;&nbsp;</p></td>
      <td><input type="text" name="societe" size="50"></td>
    </tr>
    <tr height="30">
      <td align="right"><p class="gras">Fonction*&nbsp;&nbsp;</p></td>
      <td><input type="text" name="fonction" size="50"></td>
    </tr>
    <tr height="30">
      <td align="right" valign="top"><p class="gras">Adresse*&nbsp;&nbsp;</p></td>
      <td><textarea rows="4" name="adresse" cols="45"></textarea></td>
    </tr>
    <tr height="30">
      <td align="right"><p class="gras">Code postal*&nbsp;&nbsp;</p></td>
      <td><input type="text" name="Code Postal" size="50"></td>
    </tr>
    <tr height="30">
      <td align="right"><p class="gras">Ville*&nbsp;&nbsp;</p></td>
      <td><input type="text" name="ville" size="50"></td>
    </tr>
    <tr height="30">
      <td align="right"><p class="gras">Pays*&nbsp;&nbsp;</p></td>
      <td><input type="text" name="pays" size="50"></td>
    </tr>
    <tr height="30">
      <td align="right"><p class="gras">E-mail*&nbsp;&nbsp;</td>
      <td><input type="text" name="E-mail" size="50"></td>
    </tr>
	<tr height="30">
      <td align="right"><p class="gras">Tél.&nbsp;&nbsp;</td>
      <td><input type="text" name="tel" size="50"></td>
    </tr>
    <tr height="30">
      <td align="right" valign="top"><p class="gras">Domaine&nbsp;&nbsp; d'activit&eacute;*</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">
      &nbsp;&nbsp;&nbsp;<input type="reset" value="Annuler" name="Annuler" class="gras"></td>
    </tr>
  </table>
</form>
 
</body>
</html>