Client side or server side validation or BOTH

ok . i starting validating and pattern matching with php but javascript offers us the same on client side .and it doesn’t let the users submit theFORM until the fileds are filled according to Programmers requirement .So , my question is
"Do i still need to implement these validations and patttern matching scripts written in PHP as well in my webpages " ???

Absolutely, YES

The user can turn off JavaScript, which will prevent the validations from checking the data. Then they can submit the form with invalid data.

In general, JavaScript should be used to make the user’s experience at the site better. It should never be used to protect server-side processes. You can validate using JavaScript which allows the user to get the error messages faster - since they don’t have to wait for a page refresh. But when they submit the form, you must validate in your PHP script as well.

Okay I got it . Thanks
BUt i have 1 more query .
For example , Suppose i have a text box and i left it empty and when i hit submit , i want that the message "text field is empty " should display right next to that TEXT field. JAVASCRIPT offers only alerts and prompts ,bUt it is indeed a Client-side validation , then what makes it show like this And HOW ??

DOne !

Sponsor our Newsletter | Privacy Policy | Terms of Service