allow only numeric value in textbox using javascript
![]() |
| allow only numeric value in textbox using javascript |
Hi Guys today we are going to learn how to allow only numeric in text box using JavaScript .
just use the below codes to do that..
index.html
<script type="text/javascript">
function checnum(as)
{
var dd = as.value;
if(isNaN(dd))
{
dd = dd.substring(0,(dd.length-1));
as.value = dd;
}
}
</script>
<div align="center">
<h2>allow only numeric value in textbox using javascript</h2>
<b> Enter Number:</b> <input type="text" id="text1" onkeyup="checnum(this)" maxlength='20' />
</div>
That's is Guys how allow only numeric value in textbox using javascript..Keep Visiting This blog for more Codes..Thank You...


No comments:
Post a Comment
Thank You for Your Comment
Note: Only a member of this blog may post a comment.