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
| <%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<script language="javascript">
function test(){
if (document.form1.nom.value === "" || document.form1.mail.value ===""){
alert("faute")
}
else alert("ok")
}
</script>
<title>JS forms</title>
</head>
<body>
<!--action="mailto:adresseMail@..." -->
<form name="form1" method="post" enctype="text/plain" onsubmit="return test()">
naam: <input type="text" size="15" name="nom">
email: <input type="text"size="15" naam="mail">
<input type="submit" value="Confirmer">
</form>
</body>
</html> |