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.
Interestingly, one piece of this module's features is part of the HTML5 standard:
http://diveintohtml5.org/detect.html#input-placeholder
Some browsers seem to support the "placeholder" attribute already, so we can add dynamic support for it in our JS. (We still need to hide the label though.)
Comment | File | Size | Author |
---|---|---|---|
#8 | compact_forms-placeholder-669878-8.patch | 4.27 KB | Jelle_S |
#4 | compact_forms_html5_placeholders.patch | 2.24 KB | mstrelan |
Comments
Comment #1
sunA bit more details in the forms section:
http://diveintohtml5.org/forms.html#placeholder
Comment #2
mstrelan CreditAttribution: mstrelan commentedSubscribe. Can this also please be added to the 6.x branch?
Comment #3
mstrelan CreditAttribution: mstrelan commentedThis is the code for 6.x
Comment #4
mstrelan CreditAttribution: mstrelan commentedPatch against HEAD attached
Comment #5
sunThis should use jQuery.support, and we should check whether there's also a common jQuery.support namespace for html5 features, so in case some other script already checked support, we simply re-use that value instead of detecting it again.
Which features of the non-html5 variant do we actually want to keep?
My first guess was that we'd create an entirely separate if condition upfront here and handle html5 differently...? Thoughts?
Powered by Dreditor.
Comment #6
mstrelan CreditAttribution: mstrelan commentedAccording to http://api.jquery.com/jQuery.support/
I haven't found any examples of people using jQuery.support for this, only Modernizr. The convention for jQuery.support seems to be to just use camelCase for the feature you're detecting.
Comment #7
mgiffordHow would this work with http://drupal.org/project/html5_tools - seems like there's room for collaboration from the http://groups.drupal.org/html5 community.
Comment #8
Jelle_SRerolled patch
Comment #9
Christophe Bourgois CreditAttribution: Christophe Bourgois commentedThis patch (#8) is working for me also for version: 7.x-1.0.
Please apply this patch