Re: Comment faire un focus sur un bouton
le 10 Jan 2010 19:03
Ca marche pas :-( voici le code complet:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<script type="text/javascript">
document.onkeypress = function(e) {
if(e.keyCode == 13) multi(form);
};
</script>
<script language="JavaScript">
<!--
function menuderoulant2(url,haut,gauche,largeur,hauteur,options){
window.open(url,"","top="+haut+",left="+gauche+",width="+largeur+",height="+hauteur+","+options);
}
//-->
</script>
<script language="JavaScript">
<!--
function multi(form){
rech = form.moteur.options[form.moteur.selectedIndex].value
switch(rech){
case "1":
window.open("http://www.ask.com/web?q="+form.q.value,"","width=1000,height=600,toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes");
break;
case "2":
window.open("http://www.baidu.com/s?wd="+form.q.value,"","width=1000,height=600,toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes");
break;
}}
//-->
</script>
</head>
<body bgcolor="#000000" link="#999999" vlink="#999999" alink="#999999">
<div align=center>
<div align=center>
<body bgcolor="#000000" link="#999999" vlink="#999999" alink="#999999">
<form>
<div align="center">
<table border="0" cellpadding="5" cellspacing="0" bgcolor="#9966FF" width="100%">
<tr>
<td bgcolor="#000000">
<div align=center>
</p>
<font face="Verdana, Arial, Helvetica, sans-serif" size="2">
<script language="JavaScript">
<!--
document.write('<select name="moteur">'+
'<option selected value="0"> choisir'+
'<option value="1">Ask '+
'<option value="2">Baidu '+
'</select>')
//-->
</script>
</font>
<div align="center">
<font face="Verdana, Arial, Helvetica, sans-serif" size="2">
<input type="text" name="q" size="55"></font></div>
<div align="center">
<font face="Verdana, Arial, Helvetica, sans-serif" size="2">
<input onClick="multi(this.form);" type="submit" value="rechercher" /></font></div>
<div align="center">
</div>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>