Allow people to use the HTML5 placeholder attribute instead of label if they so desire.

CommentFileSizeAuthor
#25 allow_use_of_html5-2754819-25-codestyle.patch2.22 KBhelmo
#25 allow_use_of_html5-2754819-25.patch5.25 KBhelmo
#22 allow_use_of_html5_placeholder_attribute_2754819-23.patch8.04 KBPerignon
#18 allow_use_of_html5_placeholder_attribute_2754819-18.patch6.49 KBmchampsee
#15 allow_use_of_html5_placeholder_attribute_2754819-15.patch9.7 KBmchampsee
#12 allow_use_of_html5_placeholder_attribute_2754819-11.patch11.7 KBmchampsee
#10 allow_use_of_html5_placeholder_attribute_2754819-10.patch8.56 KBPerignon
#9 allow_use_of_html5_placeholder_attribute_2754819-9.patch8.87 KBPerignon
#2 mailchimp-placeholder-2754819-2.patch5.61 KBmchampsee
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mchampsee created an issue. See original summary.

mchampsee’s picture

Status: Active » Needs review
Perignon’s picture

Status: Needs review » Needs work

Functionally, this patch works but needs a little cleanup. Three instances of white spaces in the patch.

I'll be glad to clean them up if you want me to.

Perignon’s picture

+++ b/mailchimp.module
@@ -1390,15 +1390,24 @@ function mailchimp_interest_groups_form_elements($list, $defaults = array(), $em
+ ¶

White space added here.

Perignon’s picture

Dreditor isn't pasting in all the code I commented on correctly. Deleting.

ShaneOnABike’s picture

I can confirm that this patch works magically on the latest dev build THANK YOU!

Perignon’s picture

Yes patch works, just needs cleaned up.

Perignon’s picture

This is a cleaned up patch removing the whitespaces. Corrected the PHPDoc parameters and fixed a code style issue with using else if

mchampsee’s picture

Fixed two issues that I found:
1)If you upgrade on an existing site with existing signup forms, PHP will throw a warning that it can't find the placeholder variable
2)Changed so that placeholder will not be applied to radio and dropdown fields

mchampsee’s picture

Status: Reviewed & tested by the community » Needs review
Perignon’s picture

Status: Needs review » Needs work

The latest patch will not apply as it is created against a tagged release of 7.x-4.4. Please re-roll patch against the development branch 7.x-4.x.

mchampsee’s picture

Status: Needs work » Needs review
Perignon’s picture

Crap. Dev changed again.

idebr’s picture

Instead of removing the #title property, why not apply '#title_display' => 'invisible'? This leaves the renderable array intact for other modules, and provides accessibility benefits as well, see https://api.drupal.org/api/drupal/developer%21topics%21forms_api_referen...

Perignon’s picture

And I also cannot apply this patch with a fresh pull from D.O

Perignon’s picture

So I found why it will not apply. It is this piece of code

@@ -495,7 +495,10 @@ function mailchimp_subscribe_process($list_id, $email, $merge_vars = NULL, $inte
       // Clear user cache, just in case there's some cruft leftover:
       mailchimp_cache_clear_member($list_id, $email);
       watchdog('mailchimp', '@email was subscribed to list @list.',
-        array('@email' => $merge_vars['EMAIL'], '@list' => $list_id), WATCHDOG_NOTICE
+        array(
+          '@email' => $merge_vars['EMAIL'],
+          '@list' => $list_id,
+        ), WATCHDOG_NOTICE
       );
     }
     else {
Perignon’s picture

Perignon’s picture

I can only think of the Title (label) being retained for legacy purposes. I say it would be a toss up to make them hidden or just delete them as he has done.

mchampsee’s picture

For what it's worth, I reached out to a blind colleague who had said that he could "see" the fields using this module.

helmo’s picture

Here's a re-roll.... it broke because of the included code style changes.
I've split it in two patch files.

The effect is OK

koppie’s picture

+1 for RTBC. Can we get this in the dev branch???

Greg Boggs’s picture

You'll need to apply the patch for the moment. But, we'll update this issue as soon as the code is committed.

  • ruscoe committed 015fab0 on 7.x-4.x authored by helmo
    Issue #2754819 by mchampsee, Perignon, helmo: Allow use of HTML5...

ruscoe credited ruscoe.

ruscoe’s picture

Status: Reviewed & tested by the community » Fixed

Works great, thank you. Committed to the dev branch.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.