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.
This patch adds support for using the jQuery Placeholder plugin, plus adds some useful features such as:
- Ability to use the #title field as the placeholder text (#placeholder = TRUE or custom label)
- Ability to hide the label element via JavaScript (#placeholder_label_hidden = TRUE)
- Support older browsers that don't support the placeholder attribute
Required the libraries module and https://github.com/danielstocks/jQuery-Placeholder. Just save the plugin as jquery.placeholder.
Comment | File | Size | Author |
---|---|---|---|
#4 | placeholder-jquery-support-1161384-2.patch | 5.94 KB | funkym |
#3 | placeholder-jquery-support-1161384-1.patch | 5.52 KB | funkym |
placeholder-jquery-support.patch | 5.13 KB | funkym |
Comments
Comment #1
bleen CreditAttribution: bleen commentedThis looks really good ... a couple of things before I would commit this:
a) It needs an hook_requirements function that checks for "libraries" and the jQuery-placeholder plugin
b) there are several (very) minor whitespace issues in the patch. Example:
white space
This is a great improvement though.
Powered by Dreditor.
Comment #2
bleen CreditAttribution: bleen commentedstatus
Comment #3
funkym CreditAttribution: funkym commentedComment #4
funkym CreditAttribution: funkym commentedLooks like the plugin needs at least jQuery 1.3.2, so we'll need to add jquery_update as a dependency.
Comment #5
bleen CreditAttribution: bleen commentedIt appears this patch is not working when you use
instead of
Comment #6
bleen CreditAttribution: bleen commentedComment #7
funkym CreditAttribution: funkym commentedThis patch seems to be working for me, maybe the module system weights need to be adjusted?
Comment #8
mariacha1 CreditAttribution: mariacha1 commentedThe link to the repo for the jquery code on github is broken.
https://github.com/danielstocks/jQuery-Placeholder
Any chance the file is somewhere else?
Comment #9
damiankloip CreditAttribution: damiankloip commentedHmm, it looks like it's been moved, maybe to https://github.com/akirk/jQuery-Placeholder..
I will have to change the docs for the 7.x branch to reflect this.
Comment #10
stewart.adam CreditAttribution: stewart.adam commentedUsing this library worked for me: https://github.com/mathiasbynens/jquery-placeholder