How to add custom validation rules for Textbox element


  1. Create a file under the following path “path/to/joomla/administrator/components/com_jforms/plugins/elements/textbox/validation/” and name it “ValidationRule.regx”.
  2. Put your Regular expression in this file without any modifiers, e.g ”[-.\w]+\@[-.\w]+”
  3. Edit the file “path/to/joomla/administrator/components/com_jforms/plugins/elements/textbox/textbox.xml”, Add a new “option” in the “validation” parameter tag as follows
	<param name="validation" control="list" label="Validation" default='' valueType='string' translate='0'>
		<option value='NoValidation'>No validation</option>
		<option value='Email'>E-mail</option>
 
		<!-- Your new validation rule -->		
		<option value='ValidationRule'>Your Validation Rule</option>
 
		<option value='Other'>Other (Specify)</option>
	</param>

Note that the file name in the “1st step” MUST match the 'value property' in the “option” tag “3rd step” ( Case sensitive )

The new validation rule should be visible now in the validation list in the WYSIWYG Form editor screen.




How to add custom preset list to List element


  1. Create a file under the following path “path/to/joomla/administrator/components/com_jforms/plugins/elements/list/common_lists/” and name it “newlist.list”.
  2. Put the elements you want in the file with each option in one line
  3. Edit the file “path/to/joomla/administrator/components/com_jforms/plugins/elements/list/list.xml”, Add a new “option” in the “validation” parameter tag as follows
	<param name="commonList" label="Common List" control="list" default='Manual' valueType='string' translate='0'>
		<option value='Manual'>Manual</option>
 
		<!-- Your custom list -->
		<option value='newlist'>Your New List</option>
 
		<option value='states'>US States</option>
		<option value='countries'>Countries</option>
	</param>

Note that the file name in the “1st step” MUST match the 'value property' in the “option” tag “3rd step” ( Case sensitive )

You should now be able to use your custom list in the WYSIWYG Form editor screen.





 
developer_faqs.txt · Last modified: 2009/01/02 08:22 by dr_drsh
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki