Monday, February 18, 2013

how to get keyboard ascii value using javascript

 how to submit form when enter key press


<script language="javascript">
function whichKey(evt) {
    if(evt.keyCode==13){
    document.f.submit();
    }
}
</script>
<form name="f" method="get" action="test1.php">
<input type="text" name="tt" onkeypress="whichKey(event);">
</form>

No comments:

Post a Comment