How to call a Javascipt function after pressing Enter key in Input type=text
by Ranganathan[ Edit ] 2012-08-28 23:47:04
<script type="text/javascript" src="jquery.js"> </script>
<script type="text/javascript">
function get() {
$('#meaning').hide();
$.post('data.php', { name: form.wordfield.value },
function(output) {
$('#meaning').html(output).fadeIn(1000);
});
}
</script>
</head>
<body>
<div id="container" style="width:100%">
<div id="header">
<ul>
<!-- <li>
</ul>
</div>
<div id="logo" style="width: 10%; float:left; position:fixed; top:0px; z-index:-1;"> <img src="logo.gif"></img></div>
<p>
<div id="searchform">
<form name="form" >
<input type="text" name="wordfield" onKeyup="get();"><input type="button" value="Translate" onClick="get();"> </form>
</div>
<div id="meaningbox">
</div>
<div id="meaning">
</div>
</p>
<div id="ad" style="width: 10%;float:right;"><!-- add section --></div>
<div id="footer">footer div goes here </div>
</div>
</body>
</html>