Server-side validation has its own important and it should be there but restricting user at very first step is always needed.
So, in this web development article, I am trying to present some requirement to limit the scope of the article, those are as follows: , User Full Name field that will allow to enter only alphabets and space character. For Example, my son’s complete name will be “Muhammad Ahmad”.
During web development, nearly always, we need to provide input validation on even simple web forms.
And in the case of the web, Java Script is the best option available for validating input client-side.
Also you can use input data validation to force user to enter appropriate data type.
For a example if there is a text field in the form to enter the users age.It works perfectly for me (just like in the program I am copying) - when the user writes something in the Text Box, he can only use digits and " " and "-" and when the format is ok the icon changes and when other textboxes are also ok, the Ok buton enables. I know that it's not exactly what I want, but maybe someone can give some clues...Now, finally, the problem: I am able to paste something from the Clipboard. It causes that when pasting only digits and " " and "-" remains as it should, but the user can't write anything. Generally i thought, that I'd like to check if the text in tb contains some unwanted elements, but I don't know how to check it.In most cases when you prompt for age as an input you can set maxlength to 2.You can do these validation events such as onclick, mouse over, on change, etc.So I can't do the two things (checking what the user is writing and pasting [with RMB click]) in one event?