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
| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Test ...</title>
<script language="JavaScript" type="text/javascript">
<!--
function validFields()
{
if (document.forms["frmTest"].elements["nom1"].value != "")
{
document.forms["frmTest"].action = 'test1.php';
document.forms["frmTest"].submit();
}
if (document.forms["frmTest"].elements["nom2"].value != "")
{
document.forms["frmTest"].action = 'test2.php';
document.forms["frmTest"].submit();
}
}
//-->
</script>
</head>
<body>
<form name="frmTest" method="POST" action="test1.php"> //test2.php
<input type="text" name="nom1" size="20">
<input type="text" name="nom2" size="20">
<input type="button" onClick="validFields();">
</form>
</body>
</html> |