Server-side form validation
From Joomla! Documentation
(Difference between revisions)
m (Adding link to difference client and server) |
m (→Validation rules: wikitable standard class, coloring too close to incomplete template) |
||
| Line 8: | Line 8: | ||
== Validation rules == | == Validation rules == | ||
| − | {| class="wikitable | + | {| class="wikitable sortable" |
| − | |- | + | |- |
| − | + | !Rule | |
| − | + | !Description | |
| − | + | !Availability | |
|- | |- | ||
| | | | ||
| Line 68: | Line 68: | ||
|- | |- | ||
|} | |} | ||
| − | |||
==Server- or Client-side validation?== | ==Server- or Client-side validation?== | ||
Latest revision as of 20:41, 27 May 2013
Note
Please note that the content on this page is currently incomplete. Please treat it as a work in progress.
- This article was last edited by Hutchy68 (talk| contribs) 23 days ago. (Purge)
| This is a article which: needs review. You can help the Joomla! Documentation Wiki by contributing to it. More pages that need help similar to this one are here. If you feel the need is satistified, please remove this notice. While actively editing, consider adding {{inuse}} to reduce edit conflicts. |
After submitting a form, you should validate your data. In Joomla this can be done via the JForm validate method (normally called in the controller via the model JModelForm).
Unlike client-side validation, the validation uses html attributes to do its validation. There is the attribute required ("true" or "required") which makes a field required and the attribute validate with a joomla or custom rule value.
E.g. field in a joomla form xml
<field name="email" type="text" class="inputbox" description="Fill in your E-mail" label="E-mail" required="true" validate="email" size="30" />