Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
i disabled the clientside validation to the "When" field(Date field) and am using field validation module for this, but when hit the "Register" button i dont get error message only if i hit the "Add another button".
I tryed this with disabled javascript and the form is working well. Disabled javascript
I had to disable the required option on date field cos of field collection bug. See http://drupal.org/node/1702612 This is why i am using field validation now. THX
Comment | File | Size | Author |
---|---|---|---|
#8 | required-date.png | 37.9 KB | mibfire |
#7 | Selection_047.png | 17.22 KB | Jelle_S |
#5 | Selection_046.png | 28.13 KB | Jelle_S |
#3 | Selection_043.png | 3.01 KB | Jelle_S |
disabled-javascript.png | 47.28 KB | mibfire |
Comments
Comment #1
attiks CreditAttribution: attiks commentedYour bug report is confusing: you do want to have client side validation for the 'when' field? But the field isn't required in your use case? What needs to be validated, the date format?
Comment #2
mibfire CreditAttribution: mibfire commentedYea it may be confusing. Date field has to be required, but i have to do this with field validation(i am using php validation and when field is empty then error is shown) cos of bug of date field. If i dont do this and set date field required and hit the "add more item" button without filling the date field then there wont be error message saying "When field is required".
Comment #3
Jelle_SFrom what I can tell from you explanation, you are using the "PHP code" validation of Field Validation?
If so, Clientside Validation does not support it, and that is why you don't see the error message when submitting the form.
The reason you do get the error message when you click "Add another" is that these messages do not come from Clientside Validation. When you click "Add another", Drupal does an Ajax callback (and bypasses Clientside Validation) and fires the server side validation (PHP). Then it returns the error messages and displays them. So when you click "Add another", Clientside Validation is not fired. It seems to me that this is more a Field Collection issue (as you said: #1702612: field collection doesn't validate multiple value entries) than a Clientside Validation issue, since I don't think it would be possible for us to support the PHP Code validator of Field Validation (or we'd have to do an ajax callback which kind of defeats the purpose of clientside validation).
I'll ask @attiks for his view on this.
Comment #4
mibfire CreditAttribution: mibfire commentedI tryed this with builtin "required field" option of field validation but this doesnt work either:( How could i do a workaround for this? FAPI Validation maybe?
Comment #5
Jelle_SWhen I check "Required field" on the edit field page of the "When" field, I get an error message as expected:
Comment #6
mibfire CreditAttribution: mibfire commentedWhat did u use? I mean "Field Validation" or "FAPI Validation" module and cutom code or built in function like required option in Field Validation? And i forgot to mention i am using entityform module here.
Comment #7
Jelle_SJust standard Drupal, edit the field settings:
Go to Structure -> Field Collections -> Click "Manage fields" next to your field collection (presumably "Trips") -> Click 'edit' next to your date field -> Check the "Required field" checkbox and save.
Comment #8
mibfire CreditAttribution: mibfire commentedYes, if i set this, it works me the same way. But i had to disable the clientside validation cos of custom date format as you can see here: http://screencast.com/t/Pb1SSeBBlHIw
If i wanna solve this i should change the date format back to sg similiar like this: 2013 04 05 what i wouldnt like. So how can i keep my date format and set the clientside validation to work?
Comment #9
Jelle_SAh yes, this should be fixed in the latest dev version. Your custom format should work then :-)
Comment #10
mibfire CreditAttribution: mibfire commentedSo now this hasnt been fixed yet. Should i do a workaround or wait for this?:/
Comment #11
mibfire CreditAttribution: mibfire commentedJelle_S?
Comment #12
Jelle_SThis has been fixed. If you download the latest dev version from the project page everything should work for you
Comment #13
mibfire CreditAttribution: mibfire commentedThx, great!!!
Comment #14
Jelle_S