<div dir="ltr">Hi Alan,<div><br></div><div>To add any custom validator for a field, We are adding one special data attribute(data-validator). The validator name that is specified will be described in javascript related to the module. When validation is triggered on any field. First validation will be triggered based on type of field then on data-validator of a field.</div><div><br></div><div><b><u>Example:</u></b></div><div><br></div><div>Please look at </div><div>1> AddFolder.tpl (layouts/vlayout/modules/Documents), Where input element with name="foldername" has data-validator as FolderName. </div><div><br></div><div>2> Which is defined in List.js (layouts/vlayout/modules/Documents/resources) which will be triggered on foldername validation on Add folder of Documents module.</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Sep 5, 2014 at 8:51 PM, Alan Lord (News) <span dir="ltr"><<a href="mailto:alanslists@gmail.com" target="_blank">alanslists@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I'd like to understand how to correctly emulate or extend the Vtiger_Base_Validator classes within my module so as to make use of as much common functionality as possible...<br>
<br>
I have two fields in a Settings screen that I would like to apply a custom validation rule to (basically to test if it is a valid Latitude,Longitude coordinate pair).<br>
<br>
I have the regex for my test, but am finding it hard to work out the right syntax to enter in the fields to trigger the validation and how to address my LatLngValidator.js class and where it should reside?<br>
<br>
<br>
Thanks<span class="HOEnZb"><font color="#888888"><br>
<br>
Al<br>
<br>
<br>
-- <br>
Libertus Solutions<br>
<a href="http://www.libertus.co.uk" target="_blank">http://www.libertus.co.uk</a><br>
<br>
______________________________<u></u>_________________<br>
<a href="http://www.vtiger.com/" target="_blank">http://www.vtiger.com/</a><br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr">With<br>Best Regards<br>Uma.S<br><div>Vtiger Team</div></div>
</div>