Fields that fail validation are not highlighted.
loze - September 28, 2008 - 17:16
| Project: | Validation API |
| Version: | 6.x-1.0-rc2 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
fields that fail validation are not highlighted with the error class. The corrcet validation message appears above the form, but there is no indication on that field, as there is with the default drupal validation.
related to that, when using AJAX validation, no message is displayed next to the field.
I'm assuming the correct field id is not being passed somewhere.

#1
i think this is related to multiple values settings in cck and how the form element is referenced.
changing line 545 in validation_api.module
from
form_set_error($element['#name'], t($message, $substitutes));to
form_set_error($element['#field_name'], t($message, $substitutes));fixes this for me, however i do not know how this could effect the modules normal operation.
#2
So, I have been reviewing this. And, I have ran into a problem with setting a specific element in an FAPI tree to have an error. #field_name will highlight all fields in a tree with an error, whereas FAPI is not reading the #name like I thought it would to determine which field to highlight on errors. So, I will be looking through some of the current CCK validation modules to see what they are doing here in a day or two.
#3
#4
Alright, was able to fix this for CCK fields and regular fields. Both fields had problems while in trees of an FAPI. RC3 will be up momentarily with the fix.
#5
Automatically closed -- issue fixed for two weeks with no activity.
#6
Hi,
for most of the invalid fields highlighting works, but
i. not for date field (in my form I have only a From date),
ii. for a text select list the color of the font was changed to red and not the border of the field.
#7
I have a validation against the 'promote' checkbox field on certain node types and it does not get highlighted when failing validation.
#8
same thing here, my cck date type isn't highlighted.