Steps to add custom form validation with UnderscoreJS:
- Step 1: Include underscoreJS and custom validation in your metadata (current example: custom/modules/Contacts/metadata/editviewdefs.php)
- Step 2: Use _.wrap function to add your custom validation before of after Sugar original check_form function which validates the form with Sugar rules (current example: custom/modules/Contacts/js/customValidation.js)
- Step 3: Make a Quick Repair & Rebuild :-)
Additional links:
- UnderscoreJS library: http://underscorejs.org
- UnderscoreJS wrap function: http://underscorejs.org/#wrap