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.
Not sure if this is being worked on at the moment, but the date widget required marker is looking rather funky in the latest dev (see attached screen shot). Right now it’s just floating up in the top left corner, it should really be displayed next to a label.
Comment | File | Size | Author |
---|---|---|---|
#12 | add-required-marker-1248786-12.patch | 1.1 KB | kenneth.venken |
#7 | add-required-marker-1248786-7.patch | 451 bytes | kenneth.venken |
#2 | date_required_marker.png | 5.22 KB | dboulet |
Screen shot 2011-08-14 at 2.35.48 AM.png | 27.09 KB | dboulet |
Comments
Comment #1
dboulet CreditAttribution: dboulet commentedThe labels were removed in #1233612: Add a checkbox so user can choose to show/hide the end date. I think that leaving them gone might be ok as long as we can implement #1248720: In-Line 'End Date' with 'to' text.. We should really find a new place for the required markers though.
Comment #2
dboulet CreditAttribution: dboulet commentedMaybe the best solution would be to add the marker next to the "Date" label, since that is technically the only component that is required to be filled.
Comment #3
KarenS CreditAttribution: KarenS commentedThe required marker is problematic because we can have such a multitude of date sub-parts and the system error processing can interfere with what the date module is trying to do. I've tried handling this in different ways over the years, with mixed results. Plus not all sub-parts are required, even within dates that are required.
Comment #4
acbramley CreditAttribution: acbramley commentedSub.
Comment #5
DamienMcKennaEach use case needs to be defined and then the correct 'required' options be made available & labeled accordingly.
One simple use case that could be solved quickly: when the time field is not displayed and the date field is required, the main element's label should have the 'required' indicator. It may also be useful to remove the extra fieldset that gets added for this use case, but that's a separate issue.
Comment #6
patrickfgoddard CreditAttribution: patrickfgoddard commentedIf this helps anyone, I needed the required asterisk to appear on the fieldset legend, so hacked it via a bit of code in a custom module:
Comment #7
kenneth.venken CreditAttribution: kenneth.venken commentedAttached is a patch that will add the red marker (form-required span) to the fieldset title in theme_date_combo.
Comment #8
Pedro Lozano CreditAttribution: Pedro Lozano commentedThe patch at #7 works perfectly for me.
Comment #9
zilverdistel CreditAttribution: zilverdistel commentedThe patch fixes the appearance of the marker indeed! Thank you. Do we need more review?
I'm still experiencing a possibly related issue: http://drupal.org/node/301538: Date field does not use #required to mark required date fields.
Comment #10
guillaumev CreditAttribution: guillaumev commentedDoes not work for me: the patch does add a required star to the fieldset legend (as expected) but does not remove the other star for me.
This can be fixed using CSS but ideally the other star should be removed...
Comment #11
AaronBaumanpatch in #7 works perfectly for me too.
guillaumev, can you provide steps to reproduce your issue on a clean install?
Comment #12
kenneth.venken CreditAttribution: kenneth.venken commentedAttached is a patch that removes the floating marker and adds it to the label.
Comment #13
AaronBauman#12 works great for me against 7.x-2.6+0-dev
Comment #14
kardave CreditAttribution: kardave commentedCan I ask why is the 'from' label/title is hidden/empty?
Kenneth's patch makes it not just empty but hides it completely.
In case of having starting and ending dates, I think label is quite essential for both.
Thanks,
David
Comment #15
citlacom CreditAttribution: citlacom commentedIt works for me over 7.x-2.6. Thanks.
Comment #16
babbage CreditAttribution: babbage commentedApplied patch in #12. Works as desired to make a required day-month-year date with select lists display the required marker.
Comment #17
ginorodrigues CreditAttribution: ginorodrigues commentedPlacing the marker in the fieldset is considerable usability problem.
Since there are limitations for a systematic fix until now (#3), is there any possible hardcoded solution similar to #6 but applied to a the field label (rather than its fieldset) of a single date field ?
Thanks!
Comment #18
szt CreditAttribution: szt commented#12 works, thanks!
Comment #19
dabblela CreditAttribution: dabblela commented+1 to #12, thanks!
Comment #20
PierreMarcel CreditAttribution: PierreMarcel commentedApplied #12 patch, it did the trick for us and so far no side effects.
Comment #21
cafuego CreditAttribution: cafuego commented#12: add-required-marker-1248786-12.patch queued for re-testing.
Comment #22
cafuego CreditAttribution: cafuego commentedCommitted to 7.x-2.x.
Comment #24
Gaofengzzz CreditAttribution: Gaofengzzz commented+1 to #12, great! thanks!