[Vtigercrm-developers] extend Validation engine (Ajax)
Preexo
preexo at googlemail.com
Thu May 26 08:12:38 GMT 2016
I would like to write an open extension which allows custom validation rules
being set to individual fields.
@Alan - Would this still be a good starting point?
http://paste.ubuntu.com/10404014/
Did you achieve to attach the validation through the vtiger ValidationEngine
without changing core files in the end? Like how did you apply your
Vtiger_GlobalPhoneCheck_Validator_Js class to the vtiger? Through an
extension?
Currently my thoughts were going like this:
- I add a hook to the user interaction of clicking the save button
- I request from my custom module if there are any validation rules for any
of the fields in this module
- I send those validation rules back to the front end
- I validate the fields in my own javascript class
- If it pass, I continue with the save event, if it fails I continue prevent
the save
Obviously my above way, I have implemented here:
https://github.com/preexo/vtiger-checkduplicates-extension
But it is not nice at all, it doesn't use the vtiger ValidationEngine and it
can be bypassed when not using the standard front end.
Just sharing my thoughts, if you have a better starting point for me, I
would highly appreciate.
The idea comes from looking at salesforce, there I can put a custom
validation rule to any of the fields, it's what we want to do too.
Alan Lord (News) wrote
> With the help of my colleague Alan Bell, it transpires that the jQuery
> ValidationEngine already supports Ajax validation inherently.
>
> I have the validation test and response working now but what is not
> happening is an actual save event when the result is true... Yet.
>
>
>
> _______________________________________________
> http://www.vtiger.com/
>
> Screenshot from 2015-02-25 14:31:28.png (12K)
> <http://vtiger-crm.2324883.n4.nabble.com/attachment/15501/0/Screenshot%20from%202015-02-25%2014%3A31%3A28.png>
> Screenshot from 2015-02-25 14:31:13.png (10K)
> <http://vtiger-crm.2324883.n4.nabble.com/attachment/15501/1/Screenshot%20from%202015-02-25%2014%3A31%3A13.png>
--
View this message in context: http://vtiger-crm.2324883.n4.nabble.com/Vtigercrm-developers-extend-Validation-engine-tp15268p19126.html
Sent from the vtigercrm-developers mailing list archive at Nabble.com.
More information about the vtigercrm-developers
mailing list