I used this code only numeric input but ^ char can input? How can i fix?
<input type="text" onkeypress='return event.charCode >= 48 && event.charCode <= 57'></input>
I used this code only numeric input but ^ char can input? How can i fix?
<input type="text" onkeypress='return event.charCode >= 48 && event.charCode <= 57'></input>
<input type="text" onkeypress='return( event.charCode >= 48 && event.charCode <= 57) || (event.charCode==94) '></input>
This will solve your purpose
function validateInput(evt)
{
if ((evt.charCode >= 48 && evt.charCode <= 57) || (evt.charCode==94))
return true;
else
return false;
}
<input type="text" onkeypress='return validateInput(event)'></input>