<html>
<form action="update.php" method="POST" name="ID">
<input type="text" name="ID" ">
<input type="Submit" value="Submit">
</form>
</html>
How can this form accept only numbers and not “a-z” or “,./’;[])(-=” ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use the javascript function isNAN to check if the value of the field “is not a number”. So, I added a onclick event to the submit button to call a function that checks it:
Hope it helps!