Difference between revisions of "Form validation"

From Joomla! Documentation

m (Added server side minium to top)
Line 1: Line 1:
Joomla has client-side and server-side form validation capabilities.
+
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.
  
 
==Client-side validation==
 
==Client-side validation==
.. is done via javascript while the user is filling in the form fields.
+
.. 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)
  
 
More here: [[Client-side form validation]], [[Joomla! client side form validation/1.7]]
 
More here: [[Client-side form validation]], [[Joomla! client side form validation/1.7]]
 
==Server-side 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.  
+
.. 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 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")
This is the minimum requirement, since everything before that can be overridden on the user side.
 
  
 
More here: [[Server-side form validation]]
 
More here: [[Server-side form validation]]
  
 
[[Category:Form fields]][[Category:Development]]
 
[[Category:Form fields]][[Category:Development]]

Revision as of 12:24, 17 September 2012

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.

Client-side validation[edit]

.. 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, Joomla! client side form validation/1.7

Server-side validation[edit]

.. is done after having submitted the form and will normally return to the form when not validated with some extra messages.
It used 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