Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,148,739 members, 7,802,240 topics. Date: Friday, 19 April 2024 at 11:27 AM

Which Is Better For Form Validation - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Which Is Better For Form Validation (934 Views)

Simple Form Validation In Reactjs Example / Blogger Bred Workshop Loading | Stay Tuned For Form Sales Date Release.. / Simple Form Validation In Reactjs Example (2) (3) (4)

(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

3 Likes 1 Share

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)

New Method To Make Money From Your Small/large Youtube Channel / Pos Software For Small Store Needed / New Year,new Ideas..let Us Develop Your Ideas ..with A Development Team Ready To

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 14
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.