Une Petite Question Simple au Passage
Posté : 06 avr. 2005, 08:35
Comment peut on forcer le curseur a se mettre dans la premiere zone de siasie du formulaire au chargement de la page?
Merci

Merci
Venez poser vos questions PHP, MySQL, HTML5, CSS, Javascript, Gestion de serveurs à la communauté PHPfrance
https://forum.phpfrance.com/
Code : Tout sélectionner
<script language="javascript">
document.nom_formulaire.nom_champs.focus();
</script><form method="post" action="page4_2.php">
<?
$img_fond="image_fond/1.jpg";
$img_fond_lar="100%";
$img_fond_haut="100%";
echo"<BODY BGCOLOR=\"blue\" TEXT=\"white\" LINK=\"white\" VLINK=\"white\" ALINK=\"white\"
WIDTH=\"$img_fond_lar\" HEIGHT=\"$img_fond_haut\" BACKGROUND=\"$img_fond\" >";
echo"<table border=0 align=center width=330 CELLSPACING=0><tr>";
echo"<td width=50%><p>Nom de l'utilisateur</td>";
echo"<td width=50%><p><input type=text name=nom></td>";//<--c'est dans ce champs que je veut mettre mon curseur au chargement
echo"</tr>";
echo"<tr>";
echo"<td width=50%><p>Nom de la machine</td>";
echo"<td width=50%><p><input type=text name=machine></td>";
echo"</tr>";
echo"<tr>";
echo"<td width=50%><p>Vitesse</td>";
echo"<td width=50%><p><input type=text name=vitesse></td>";
echo"</tr>";
echo"<tr>";
echo"<td width=50%><p>IP</td>";
echo"<td width=50%><p><input type=text name=ip ></td>";
echo"</tr>";
echo"<tr>";
echo"<td width=50%><p>MAC</td>";
echo"<td width=50%><p><input type=text name=mac ></td>";
echo"</tr>";
echo"<tr>";
echo"<td width=50%><p>Systeme d'exploitation</td>";
echo"<td width=50%><p><input type=text name=os ></td>";
echo"</tr>";
echo"<tr>";
echo"<td width=50%><p>Localisation</td>";
echo"<td width=50%><p><input type=text name=localisation></td>";
echo"</tr>";
echo"<tr>";
echo"<td height=20></td>";
echo"<td height=20></td>";
echo"</tr>";
echo"<tr>";
echo"<td width=135 align=center valign=center><input type=submit name=expedier value=Envoyer></td>";
echo"<td width=126 align=center valign=center><input type=reset name=annuler value=Annuler></td>";
echo"</tr>";
echo"</table>";
?>
[/b]<form method="post" action="page4_2.php" name="formname">
<?php
$img_fond="image_fond/1.jpg";
$img_fond_lar="100%";
$img_fond_haut="100%";
?>
<BODY BGCOLOR="blue" TEXT="white" LINK="white" VLINK="white" ALINK="white" WIDTH="<?php echo $img_fond_lar;?>" HEIGHT="<?php echo $img_fond_haut;?> BACKGROUND="<?php echo $img_fond;?>">
<table border=0 align=center width=330 CELLSPACING=0>
<tr>
<td width="50%">Nom de l'utilisateur</td>
<td width="50%"><input type=text name=nom>
<script language="javascript">
document.formname.nom.focus();
</script>
</td>
</tr>
<tr>
<td width="50%">Nom de la machine</td>
<td width="50%"><input type=text name=machine></td>
</tr>
<tr>
<td width="50%">Vitesse</td>
<td width="50%"><input type=text name=vitesse></td>
</tr>
<tr>
<td width="50%">IP</td>
<td width="50%"><input type=text name=ip ></td>
</tr>
<tr>
<td width="50%">MAC</td>
<td width="50%"><input type=text name=mac ></td>
</tr>
<tr>
<td width="50%">Systeme d'exploitation</td>
<td width="50%"><input type=text name=os ></td>
</tr>
<tr>
<td width="50%">Localisation</td>
<td width="50%"><input type=text name=localisation></td>
</tr>
<tr>
<td height="20"></td>
<td height="20"></td>
</tr>
<tr>
<td width="135" align="center" valign="center"><input type=submit name=expedier value=Envoyer></td>
<td width="126" align="center" valign="center"><input type=reset name=annuler value=Annuler></td>
</tr>
</table>