<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Javascript : OnkeyPress</title>
</head>
<script language="Javascript1.2" type="text/javascript">
<!--
function appuieToucheEntree (event) {
if (event.type == "keydown" & event.keyCode == 13){
alert('ENTREE');
document.getElementById('testeuh').focus();
event.keyCode=13;
<!--document.myform.submit();-->
return false;
}
}
</script>
<form action="javascript
:alert('soumission formulaire')" method="get">
<input id="teste" name="sfgsgsf" type="text" onKeyDown="appuieToucheEntree(event);">
<input id="testeuh" name="gdfg" type="submit" onClick="javascript
:alert('onclick');">
</form>
<body>
</body>
</html>
Partager