When adding a Field API Date field (for a Date of Birth), the clientside_validation doesn't work if no date is being entered ("required" validation).

I notice the same thing is happening in the demo here:
http://validation7.ubu001.attiks.com/examplesform?utm_medium=atix&utm_so...

Am I missing something, or is this a bug?

CommentFileSizeAuthor
#2 i1669570-2.png3.02 KBattiks
#3 i1669570-2b.png3.64 KBattiks
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

attiks’s picture

On that page there's always a date filled in, so can you provide some more details.
Is this in a node/edit, webform, custom form?

attiks’s picture

FileSize
3.02 KB

I tried this with a field on a node, but it renders without the * and after submitting it returns an error "A valid date is required for date." but I assume they changed something, to be continued ...

Screenshot is if you select required and no default value:

i1669570-2.png

attiks’s picture

FileSize
3.64 KB

I you specify a default value (i selected now), you'll get this

i1669570-2b.png

svendecabooter’s picture

Yeah the demo example is indeed already filled in. Didn't notice that, my bad :)

I have indeed a date field (granularity year - month - day) that has no default values.
It renders exactly as your screenshot in #2.

attiks’s picture

Status: Active » Postponed

Date moves the #required to the parent element, but that isn't really the right way to handle it, see #301538: Date field does not use #required to mark required date fields

This has to be fixed by the date module, sorry :/

attiks’s picture

Status: Postponed » Closed (works as designed)