Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
For example you want the user to check that he agrees to terms of use, etc..
Comments
Comment #1
Jelle_SCan you be more specific? I just tested with the latest dev version and a single on/off checkbox that is required works for forms built with the Form API, for fields on entities and for webforms...
What exactly isn't working for you?
Comment #3
Jelle_SSpammer... has been reported
Comment #4
ramsegal CreditAttribution: ramsegal commentedSpammer? huh?
I had to add a require rule with hook_validation_fapi_validation_rules, if i use only '#required'=>TRUE to the field, it's only been validated server side..
Thanks anyways.
Comment #5
Jelle_SSorry, that wasn't about you, if you look closely, comment #2 is deleted, because the spammer account was deleted ;-)
If you get the latest dev version from git, it should work only setting '#required' => TRUE
Comment #6
attiks CreditAttribution: attiks commentedOn what form did you have this: custom form, user registration form, ... Any other modules you used?
Comment #7
ramsegal CreditAttribution: ramsegal commentedHi, thanks for supporting!
It happens to me on a custom form, the field code:
For this code, i can submit the form, no clientside validation.
I added a custom rule with hook_validation_fapi_validation_rules, and used fapi (#rules => ...), so on submit the checkbox is validated, however no message to the user...
I am still struggling with this, i don't want to update to the latest dev version because i want to keep the inline error messages (and one error message at a time)
Thanks!
Comment #8
attiks CreditAttribution: attiks commentedI tried this using the following and it works (latest dev version), any javascript errors? What does Drupal.settings.clientsideValidation look like when you view the source of the page?
Comment #9
attiks CreditAttribution: attiks commentedComment #10
ak CreditAttribution: ak commentedHi, I am using this on a simple node form. I got the same problem with the 7.x-1.31 release. It's only validating textfields and texareas but no error messages for checkbox or select dropdowns.
I tried using the current dev version as mentioned but that gives me a php error with my hierarchical select taxonomy field:
(Notice: Undefined index: field_country[und] in clientside_validation_regular() (line 172 of … /clientside_validation_form.module))
A lot has hanged in the current dev version. Is there a simple fix or patch to this issue for the 7.x-1.31 release?
Thank's for advice.
Comment #11
attiks CreditAttribution: attiks commentedWhat version of Drupal are you using?
Comment #12
ak CreditAttribution: ak commentedMy site is running Drupal 7.12. Is the Drupal version related?
Comment #13
attiks CreditAttribution: attiks commentedDo you get any javascript errors?
Can you post the content of Drupal.settings.clientside_validation?
Is this is a single checkbox or multiple?
Post a screenshot if you can
Comment #14
ramsegal CreditAttribution: ramsegal commentedI installed the latest dev version (22-05-12), no luck, required checkbox isnt being validated.
Comment #15
attiks CreditAttribution: attiks commented@ramsegal, what's the difference between your form and the one in #8
Comment #16
ramsegal CreditAttribution: ramsegal commentedi have some more fields, one special - captcha.
other than that...same.
Comment #17
Jelle_SI just tested with this (very basic) form and the checkbox got validated:
@ramsegal:
What do your js settings look like? Could you post it here?
Comment #18
ak CreditAttribution: ak commentedI am now going with the dev version of this module.
I can confirm that is does validate my checkbox and my node reference select box as expected.
In response to #13 and version 7.x-1.31:
– No Javascript errors occur.
– It's a single checkbox, a taxonomy term- and node reference-select box.
– Btw. I got jquery_update module installed with jquery 1.5.x.
– Here's some settings code, the checkbox as example appears:
Comment #19
attiks CreditAttribution: attiks commentedjquery_update might be the problem, but not sure
Comment #20
Jelle_Sjust tested the form from #17 again with jquery update enabled (jquery-1.5.2) and everything still worked as it should...
Comment #21
Jelle_S@ak: can you post a screenshot of your fields (so I can see the type & widget) so I can try to reproduce?
Comment #22
ak CreditAttribution: ak commentedThe dev version fixed the problem for me. Checkboxes and selects validate fine with dev, so I'm sticking with that. I would recommend to make a new full releas version asap that fixes this bug for all users. Best regards.
Comment #23
attiks CreditAttribution: attiks commentedComment #25
ramsegal CreditAttribution: ramsegal commentedI found the problems i had:
1. select - i use the module selectmenu, which breaks the clientside validation.
2. checkbox - i have a multistep form, which i didnt implement right. the checkbox is in the second step. because i called the form builder function directly, the validation was on the first step elements, once i changed it to drupal_get_form everything works as expected.
So nothing related to clientside validation module..
Thanks for the support
Comment #26
pyxio CreditAttribution: pyxio commentedI have the same problem with a single on/off boolean checkbox on user register form. If i check the field settings i see the Exclude from clientside validation option and it is unchecked. If I check source code there is no validation error label being created for this specific form element. I am using module version 7.x-1.44
Comment #27
asamant6 CreditAttribution: asamant6 commentedRecently I have faced one issue due to use of clientside_validation module (v1.46).
Issue :: If user submits a form without filling any data, error list will be shown as expected. After this if user selects first mandatory checkbox (first input also) , all errors will hide from the error list at a glance. Again if user unchecks the checkbox, only one error related to this checkbox will be shown. All errors can be shown again if user is trying to submit the form without filling it. This issue happens when we are going to display the error list on the top of any form and the first element is mandatory checkbox.
I haven't found any patch for this issue. For now I have fixed this issue using custom implementation where form validator has been triggered manually. I will try to post one patch here if possible.
Please reopen this issue.
Comment #28
gobinathmReopening as requested by asamant6 in chat.