Actions

Difference between revisions of "Form validation"

From Joomla! Documentation

(Adding fact that client-side is more user-friendly)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
<noinclude><languages /></noinclude>
 +
<translate><!--T:1-->
 
Joomla has client-side and server-side form validation capabilities.<br/>
 
Joomla has client-side and server-side form validation capabilities.<br/>
Server side validation is the minimum since everything before that can be overridden on the user side. But client-side is the most user-friendly one, so using both is not a bad idea (especially since the latter is unobtrusive and won't give problems on javascript-disabled or -problematic client browsers).
+
Server side validation is the minimum since everything before that can be overridden on the user side. But client-side is the most user-friendly one, so using both is not a bad idea (especially since the latter is unobtrusive and won't give problems on javascript-disabled or -problematic client browsers).</translate>
  
==Client-side validation==
+
<translate>==Client-side validation== <!--T:2--></translate>
 +
<translate><!--T:3-->
 
.. is done via javascript while the user is filling in the form fields.<br/>
 
.. is done via javascript while the user is filling in the form fields.<br/>
It uses the HTML '''classes''' <u>required</u> and <u>validate-[xxx]</u> (with [xxx] being a joomla or custom rule; e.g. validate-numeric)
+
It uses the HTML '''classes''' <u>required</u> and <u>validate-[xxx]</u> (with [xxx] being a joomla or custom rule; e.g. validate-numeric)</translate>
  
More here: [[Client-side form validation]], [[Joomla! client side form validation/1.7]]
+
<translate><!--T:4-->
==Server-side validation==
+
More here: [[S:MyLanguage/Client-side form validation|Client-side form validation]]</translate>
 +
 
 +
<translate>==Server-side validation== <!--T:5--></translate>
 +
<translate><!--T:6-->
 
.. is done after having submitted the form and will normally return to the form when not validated with some extra messages. <br/>
 
.. is done after having submitted the form and will normally return to the form when not validated with some extra messages. <br/>
It used the HTML '''attributes''' <u>required</u> ("true" or "required") and <u>validate</u> (with value being a joomla or custom rule; e.g. validate="email")
+
It uses the HTML '''attributes''' <u>required</u> ("true" or "required") and <u>validate</u> (with value being a joomla or custom rule; e.g. validate="email")</translate>
  
More here: [[Server-side form validation]]
+
<translate><!--T:7-->
 +
More here: [[S:MyLanguage/Server-side form validation|Server-side form validation]]</translate>
  
[[Category:Form fields]][[Category:Development]]
+
<noinclude>
 +
<translate>
 +
<!--T:8-->
 +
[[Category:Form fields]]
 +
[[Category:Development]]
 +
</translate>
 +
</noinclude>

Latest revision as of 06:16, 24 July 2015

Other languages:
English • ‎español • ‎français • ‎Nederlands

Joomla has client-side and server-side form validation capabilities.
Server side validation is the minimum since everything before that can be overridden on the user side. But client-side is the most user-friendly one, so using both is not a bad idea (especially since the latter is unobtrusive and won't give problems on javascript-disabled or -problematic client browsers).

Client-side validation

.. is done via javascript while the user is filling in the form fields.
It uses the HTML classes required and validate-[xxx] (with [xxx] being a joomla or custom rule; e.g. validate-numeric)

More here: Client-side form validation

Server-side validation

.. is done after having submitted the form and will normally return to the form when not validated with some extra messages.
It uses the HTML attributes required ("true" or "required") and validate (with value being a joomla or custom rule; e.g. validate="email")

More here: Server-side form validation