Bonjour,

Je souhaite mettre le focus de saisie sur un champ "topo_rech" d'un formulaire "form_recherche_syn" défini plus pas dans ma page.

Voici mon code de dépare:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
 
<body bgcolor="#F3FFFF" onLoad="setfocus();" text="#000000" topmargin="0" marginheight="0" leftmargin="0" marginwidth="0" link="#000000">
<script type="text/javascript">
<!--
function go_recherche_syn() {
	document.form_recherche_syn.action="recherche_syn.php";
	document.form_recherche_syn.submit();
}
function setFocus() {
 
    document.form_recherche_syn.topo_rech.select();
    document.form_recherche_syn.topo_rech.focus();
}
-->
</script>
et plus loin mon forulaire ...
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
    <form name="form_recherche_syn" action="" method="get" >
         <tr>
            <td align=center colspan=2>
                Recherche Syntaxique :
         </td>
         </tr>
 
         <tr>
            <td valign=left>
                Tapez le nom du tomponyme recherch&eacute;
            </td>
            <td align=center>
                <input type="text" name="topo_rech" size="30" value="<? echo $topo_rech ;?>" maxlength="30" onKeyUp="go_recherche_syn(this.form);">
                <input type="hidden" value="rechercher" name="rechercher" onClick="go_recherche_syn(this.form);">
            </td>
         </tr>
 
    </form>
Le focus ne se mets pas sur le champ demandé, qu'en pensez vous !!!