₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,331,094 members, 8,448,641 topics. Date: Monday, 20 July 2026 at 04:03 PM

Toggle theme

Which Is Better For Form Validation - Programming - Nairaland

Nairaland ForumScience/TechnologyProgrammingWhich Is Better For Form Validation (1077 Views)

1 Reply (Go Down)

Which Is Better For Form Validation by Nobody: 6:13am On Nov 28, 2018
To Web developers in the house, which is better for form validation, Php (back-end) or javascript(front-end)?
Re: Which Is Better For Form Validation by Nobody: 10:03am On Nov 28, 2018
both
Re: Which Is Better For Form Validation by Nobody: 4:00pm On Nov 28, 2018
charliboy654:
To Web developers in the house, which is better for form validation, Php (back-end) or javascript(front-end)?
Let me just start with this, whatever you do you should have some sort of server validation in place.

Js validation is extremely useful from a ux point of view. Users don't need to submit the form first before being notified of validation errors and this makes for a wonderful user experience.

but js runs on the client and you usually have no control over this. The user might have js disabled and thus your script won't run and he will bypass the validation process or advanced users can manipulate the script and temper with the validation rules.

php validation should serve as your last guard to user submitted content as this runs on the server and the user can't turn it off or manipulate.

so the answer is both have their places. js is used to improve ux while php ensures that the right data is stored.

if you were to pick one though, definitely php
Re: Which Is Better For Form Validation by Nobody: 5:33pm On Nov 28, 2018
eberedigital:
Let me just start with this, whatever you do you should have some sort of server validation in place.

Js validation is extremely useful from a ux point of view. Users don't need to submit the form first before being notified of validation errors and this makes for a wonderful user experience.

but js runs on the client and you usually have no control over this. The user might have js disabled and thus your script won't run and he will bypass the validation process or advanced users can manipulate the script and temper with the validation rules.

php validation should serve as your last guard to user submitted content as this runs on the server and the user can't turn it off or manipulate.

so the answer is both have their places. js is used to improve ux while php ensures that the right data is stored.

if you were to pick one though, definitely php
OK, thank u very much, am a new developer actually using javascript for form validation until a friend told me php would be safer which actually made sense, but I felt javascript would be better for user experience.
Re: Which Is Better For Form Validation by ensodev(m): 10:46pm On Nov 28, 2018
eberedigital:
Let me just start with this, whatever you do you should have some sort of server validation in place.

Js validation is extremely useful from a ux point of view. Users don't need to submit the form first before being notified of validation errors and this makes for a wonderful user experience.

but js runs on the client and you usually have no control over this. The user might have js disabled and thus your script won't run and he will bypass the validation process or advanced users can manipulate the script and temper with the validation rules.

php validation should serve as your last guard to user submitted content as this runs on the server and the user can't turn it off or manipulate.

so the answer is both have their places. js is used to improve ux while php ensures that the right data is stored.

if you were to pick one though, definitely php
My oga said it all...
1 Reply

How To Create Mysql Database/python Tkinter Gui To Change Password/Validation EnReactive Forms And Form Validation In Angular With ExampleSimple Form Validation In Reactjs Example234

Programming MateWhat Program Can I Learn During This Short HolidayHow Exactly Do VPN Free Browsing Cheats Work? Anyone?