Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I think what you're asking about is actually adding custom validation to one of your form fields. If that's the case you actually need to be looking at <a href="http://docs.joomla.org/J2.5%3aDeveloping_a_MVC_Component/Adding_verifications" rel="nofollow">adding server-side validation</a> in addition to <a href="http://docs.joomla.org/J2.5%3aDeveloping_a_MVC_Component/Adding_configuration" rel="nofollow">adding configuration</a>. Pay particular attention to the 'addrulepath' in the example under the heading "Using configuration parameters as default value". You'll most likely end up extending JFormRule, of which I've included a very stripped-down example below.</p> <pre><code>&lt;?php /** headers */ defined('JPATH_PLATFORM') or die; // Joomla only class JFormRuleCustom extends JFormRule { public $type = 'Custom'; public function test(&amp;$element, $value, $group = null, &amp;$input = null, &amp;$form = null) { return /* true for passed validation, false for failed validation */ } } </code></pre> <p>When you've got that down you can add the validation "custom" to your form fields like so:</p> <pre><code>&lt;field name="pw1" type="password" label="COM_NEWUSER_UPDATE_LABEL_PASSWORD1" description="COM_NEWUSER_UPDATE_DESCRIPTION_PASSWORD1" message="COM_NEWUSER_UPDATE_ERROR_PASSWORD1" size="40" required="true" validate="custom" minlength="5" maxlength="20" specials="!@#$%^&amp;amp;*" /&gt; </code></pre> <p>Hopefully that answers your question and didn't go totally off-topic.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload