<script type="text/javascript"> // function pageLoad() { // alert("deltiming.innerHTML"); // } function numonly(evt) { // debugger; var nbr; var nbr = (window.event) ? event.keyCode : evt.which; if (nbr >=01 && nbr <=23 ) { return true; } else { alert("Mention the time correctly"); return false; } } function nummin(evt) { var min; var min = (window.event) ? event.keyCode : evt.which; if (min >=00 && min <= 59) { return true; } else { alert("Mention the time correctly"); return false; } } function timing() { var deliverytime = document.getElementById("deltiming"); var html = "<table class=\"tbl1\" align=\"center\"><tr><td>HH</td><td>MM</td></tr><tr><td><input type='text' size='1' maxlength='2' onkeypress=\"javascript:return numonly(event);\" /></td><td><input type='text' size='1' maxlength='2' onkeypress=\"javascript:return nummin(event);\" /></td></tr></table>"; deliverytime.innerHTML = html; } </script>
<html>> <HEAD> <SCRIPT language="Javascript"> <!-- function isNumberKey(evt,val) { var charCode = (evt.which) ? evt.which : event.keyCode if (charCode > 31 && (charCode < 48 || charCode > 57)) { alert("Mention the time correctly"); return false; } else { if(val>23) { return false; alert("Mention the time correctly"); } else { return true; } } } //--> </SCRIPT> </HEAD> <BODY> <INPUT id="txtChar" onkeypress="return isNumberKey(event,this.value)" type="text" name="txtChar"> </BODY> </HTML>
var min = (evt.keyCode) ? evt.keyCode : evt.which;
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)