Closed (fixed)
Project:
Clientside Validation
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
13 Sep 2012 at 23:59 UTC
Updated:
28 Sep 2012 at 17:21 UTC
The documentation explains how to let know clientside_validation of custom #element_validate validations.
We currently have custom validations for various form elements using $form['#validate'][] = 'our_validation_function';, on a per form basis.
Can those #validate functions be recognized by clientside_validation?
Is there any advantage on using #element_validate?
Thanks !
Comments
Comment #1
attiks commented#element_validate works on an element, #validate on the form
We'll have a look
Comment #2
jelle_sFixed in latest dev & updated the documentation.
EDIT:
In answer to your question:
#element_validatevalidates a single element in your form, so you're more likely to be able to reuse the function for other elements (e.g. checking for positive numeric values etc.)#validateacts on the entire form, so you have more context.There's no 'best practice' defined about their usage as far as I'm aware.
Comment #3
rafamd commentedattiks++
Jelle_S++
Thanks so much for making this module plain awesome! Everything's very clear.