Bonjour!
J'ai un problème concernant la validation des champs de mon formulaire.
Je crois que le problème réside dans l'utilisation de deux tableaux. Je
vous présente mon code tel qu'il est et j'espère que vous pourrez le
corriger. Merci.
Code:
!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.style4 {font-family: "Times New Roman", Times, serif}
.style6 {font-family: "Times New Roman", Times, serif; color: #FFFFFF; }
.style7 {
color: #FFFFFF;
font-weight: bold;
}
-->
</style>
</head>
<body topmargin="0" leftmargin="0">
<form action="http://127.0.0.1/projet1/authent.php" method="post"
name="authent" id="authent" onsubmit="return(check(this));">
<table width="630" border="0" cellpadding="0" cellspacing="0" bgcolor="#175592">
<tr>
<td><blockquote>
<p> </p>
<p align="left"><img src="auth.gif" width="441" height="12"></p>
<table width="350" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><pre><strong><span class="style6">Login
du responsable:</span></strong></pre></td>
<td align="center"><div align="left"><strong>
<input name="login" type="text" id="login3" size="30"
maxlength="20">
</strong></div></td>
</tr>
<tr>
<td><pre class="style7"><span class="style4">Mot de
passe</span>:</pre></td>
<td><div align="left"><strong>
<input name="pass" type="password" id="pass4" size="30"
maxlength="20">
</strong></div></td>
</tr>
</table>
<p><strong>
<input type="submit" name="Submit" value="Valider">
<input type="reset" name="Submit2" value="Effacer">
</strong></p>
</blockquote> <p
align="left"><strong></strong></p>
<p
align="left"><strong>
<img src="auth2.gif" width="441"
height="12"></strong></p></td>
</tr>
</table>
<p> </p>
</pre>
</form>
<script language="JavaScript"><!--
function check(f)
{
if(f[0].value == '')
{
alert('Indiquez votre Login, SVP.');
return(false);
}
if(f[1].value == '')
{
alert('Indiquez votre Mot de passe, SVP.');
return(false);
}
return (true);
}
//--></script>
</body>
</html>