Which is mostly used as validators? Javascript or php? | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
+ 1

Which is mostly used as validators? Javascript or php?

which is easier and how to implement it ?with example in webpage

1st Mar 2017, 10:41 AM
Amith Raj
Amith Raj - avatar
3 Respuestas
+ 11
By default both is used. Server side(PHP) - to prevent hackers or wrong inputs Client side(JS) - to help user fill up forms, so it will not lose all his data if something will be filled wrong. But it also requires 'required' keyword on input to work
1st Mar 2017, 11:13 AM
WittyBit
WittyBit - avatar
+ 11
@Dev 100% use PHP(Security, you know) And JS - for User friendly validation( Stansart JS validation, or using AJAX)
2nd Mar 2017, 9:21 AM
WittyBit
WittyBit - avatar
+ 1
As Michael said, you can use both languages for validation. I personally do everything with PHP, but it's just personal choice.
2nd Mar 2017, 8:31 AM
Dev
Dev - avatar