function validate(evt) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode(key); var regex = /[0-9]/; if (!regex.test(key)) { theEvent.returnValue = false; if (theEvent.preventDefault) theEvent.preventDefault(); } }
<input type="text" class="txtForexAmt" placeholder="0" value="@Model.TotalNoOfUnit" maxlength="10" />
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)