input data for textbox only numeric-number php

Often a textbox we enter a numeric value, but the implementation is currently in the input character anyway, it is also acceptable. In this post how it is anticipated that the textbox does not receive the letter, compulsory figures. follow source code below.


<script type="text/javascript">
function VerifyNum(textBox){
var nvalid = parseFloat(textBox.value) ;
if ( isNaN(nvalid) ) {
alert ("Nilai yang dimasukkan harus angka !");
textBox.value = "0" ;
return (false);
}else{
return (true);
}
}

</script>

<body>
<form id="form1" name="frmhitung">
Validasi Nilai Harga Penjualan<br />
Harga Penjualan : <input name="harga" type="text" id="harga" onKeyUp="VerifyNum(this)" />
</form>

</body>

Subscribe to receive free email updates:

0 Response to "input data for textbox only numeric-number php"

Post a Comment