+ 3
How can I Complete form validation using js
3 Answers
+ 3
form validation using only js (client side) may not be an ideal solution from a sec'ty point of view.
Consider also server side validation and filtering.
You can reference to this php form example from w3schools.com
https://www.w3schools.com/php/php_form_complete.asp
+ 3
thanks seamiki, but I have no knowledge of php. Can you please tell me about only client side validation because I am beginner.
+ 3
the client side can be mostly done with html5 elements and attributes. You can start escaping illegal chars from textfield entries with JS as shown in the example with php but you'll have to repeat it on the server side before sending those values to the database, to avoid sql injection. On the client side you're always vulnerable.