Hi.
i provided custom webform validation for custom webform field
so. i created component by means of _webform_defaults_component
My components was multiply and it has form name like like submitted[my_componet][id_of_component]
it works fanny for webform, but it has some problems with webform_validation module
hook webform_validation_validate should return a errors array with keys a contained name of field
$errors['item_1'] = 'erros text';
i propose to allowed using multi keys
$errors['item_1'][id_of_value] = 'erros text';
so, i'm attached patch to decide this problem
p.s. I can provide more information to answer why this problem is important
Comments
Comment #1
liam morlandCan you explain more why this is needed? Are you making a custom component which is a compound component, that is, one component which contains multiple form controls or multiple parts?
Comment #2
spheresh commentedMy custom component is a table, one of cell is input field. It has nothing to do with the compound component of multiple form (multi step form), just simple component, but this component can have to much values.
after form was submitted, drupal showing a error

but, it is wrong. field that contains the values for the item2 should not be highlighted as an error
so this patch allows to highlight a field that is a name like this
submitted[orders][MULTI_FIELD_ID]P.S. "webform_submitted_data" database table has field "no" for save multi values, but anyother component did not use it for highlighted element of form, now.
Comment #3
spheresh commentedComment #4
liam morlandThe patch does not apply. Please re-roll against the latest development version.
Comment #5
spheresh commentedComment #6
liam morlandDo I have this right: You have a custom Webform component which has multiple HTML form controls in it. With this patch, you can set errors against the individual sub-components instead of only against the entire component. Is that right?
Comment #7
spheresh commentedYou are right. I'm using it in my some projects. I'm contributing one of this (link for example Webform Orders)
You may think that it is my local problem, but it is not right.
Webform using a multiple values. For example, a data field using multi value also.
we can see on this is screen what a day field is filled correctly, but it is marked as wrong, so only month and year fields should be to marked
this patch allow make a validation a more clearly, like screen

Example of validator
P.S. I wrote this validator is very fast, only to show the principle of the patch)
Comment #8
liam morlandThanks very much.
http://drupalcode.org/project/webform_validation.git/commitdiff/5153ec3
http://drupalcode.org/project/webform_validation.git/commitdiff/23ba784
Comment #9
liam morlandComment #10
liam morlandDrupal 6 is no longer supported.