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
| <html>
<head>
<title>Formulaire</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript" src="mootools.js"></script>
<script type="" language="javascript">
function check() {
var msg = "";
if ((document.formulaire.email.value == "")||(document.formulaire.email.value == "email")){
msg += "Veuillez saisir votre email\n";
document.formulaire.email.style.backgroundColor = "#ff358b";
}else{document.formulaire.email.style.backgroundColor = "#ffffff";}
if ((document.formulaire.message.value == "")||(document.formulaire.message.value == "Message")){
msg += "Veuillez saisir votre Message\n";
document.formulaire.message.style.backgroundColor = "#ff358b";
}else{document.formulaire.message.style.backgroundColor = "#ffffff";}
if (msg == "") {SendForm();}
else {
alert(msg);
}
}
function SendForm(){
$('BTsubmit').disabled='disabled';
$('BTsubmit').value='en cours ...';
$('message').disabled='disabled';
$('email').disabled='disabled';
var ajaxRequest = new Ajax('envoi.php', {
method:'post',
asynchronous: true,
contentType:'application/x-www-form-urlencoded',
encoding:'UTF-8',
onComplete: function(){MailOK();},
});
/var requestVar = {
email: $('email'),
message: $('message')
};
ajaxRequest.request();
function MailOK(){
$('BTsubmit').style.visibility = 'hidden';
$('BTsubmit').style.display = 'none';
$('textOK').style.visibility = 'visible';
$('textOK').style.display = 'block';
}
}
</script>
</head>
<body>
<form name="formulaire" id="formulaire" onsubmit="check();">
adresse e-mail :<br />
<input name="email" id="email" value="" size="30" maxlength="100">
<br />
<br />
message <br />
<textarea name="message" cols=30 rows=4 wrap="VIRTUAL" id="message"></textarea>
<br />
<br />
<input id="BTsubmit" style="BACKGROUND-COLOR: #cccccc" type=button value="Envoyer" onClick="check(); " >
<div id="textOK" style="visibility: hidden; display: none">votre message a bien été envoyé<br>merci</div>
</form>
</body>
</html> |
Partager