date field custom placeholder?
-
I understand that the date placeholder needs to be in the format “yyyy-mm-dd” or use terms like “today”, but I need to use a custom text string instead. The rest of my complex form uses only placeholders and no labels, which significantly compacts the form and makes it look cleaner.
Being forced to use a label instead of simply using “Date of Birth” as placeholder for the date field breaks the form layout, pushing fields out of alignment and completely wrecks the aesthetics.
Yes, I can just use the date field w/o label, but it isn’t perfectly obvious that this field is meant for Date of Birth rather than something else, such as the date the form was filled out and/or signed.I tried a trick that somehow worked for this guy in 2021, but I can’t get it to work: video: date field placeholder trick
In that short video, he does it like this:
[date date-614 placeholder “Schedule: “] as his shortcode, then he adds this CSS rule:.wpcf7 input[type="date"]:before { content: attr(placeholder); }
And just like that, “Schedule: ” shows up on his date field to the left of “mm/dd/yyyy” as soon as he enters the new rule, and the date picker functions normally.
I also tried using watermark instead of placeholder, no joy.
Has anyone else gotten this trick to work? Did it really work at one time and a CF7 update has made this impossible now?
- The topic ‘date field custom placeholder?’ is closed to new replies.