Active
Project:
Simplenews
Version:
7.x-1.x-dev
Component:
User interface
Priority:
Minor
Category:
Feature request
Assigned:
Unassigned
Reporter:
Anonymous (not verified)
Created:
24 Apr 2011 at 04:26 UTC
Updated:
26 Dec 2019 at 09:34 UTC
Jump to comment: Most recent
Comments
Comment #1
simon georges commentedWhat kind of default value would you put ?
(you can do it using hook_form_alter or theme function for the form, if you don't mind coding)
Comment #2
Anonymous (not verified) commentedRemoved
Comment #3
miro_dietikerMinor then.
Comment #4
berdirThe problem is that using the existing value property results in bad Usability because users first need to remove the value before they can insert their own. I know that I've seen a issue that reports exactly this problem for the 6.x-1.x branch, can't find it anymore.
If at all, it should be done using the new HTML 5 placeholder property: http://davidwalsh.name/html5-placeholder and/or a JavaScript fallback mechism.
Comment #5
miro_dietikerIn general this is a feature that is against accessibility rules (as long as it doesn't follow some fancy new standard...)
Also it can be easily covered in custom code with a form_alter.
I already see people asking in how to customize this message once we added it... ;-)
For HTML4 i clearly vote against such a feature.
For HTML5 and where a standards compliant solution is possible, we should add that support. (BTW: There's absolutely no need to provide a fallback...)
Won't fix if this is risky for some reason. Such a workaround per module would be completely wrong. Changing the paradigm of fapi forms is a global thing, not something for a per-module context.
Comment #6
berdirAgreed on the FAPI comment. FAPI is extendable, though. In fact, the html5_tools project already implements and supports the #placeholder property, see #1068634: Placeholder functionality.
So if we implement this, we could just set #placeholder and tell users to install html5_tools if they want it.
And yes, it was already requested in this issue to make that string customizable...
Comment #7
miro_dietikerThat's cool.
Comment #8
miccelito commentedSo what would the steps be to add a #placeholder?
1. Install HTML5 Tools http://drupal.org/project/html5_tools and Elements http://drupal.org/project/elements
2. Add
''#placeholder' => t('Your e-mail address...'),to simplenews.subscription.inc file??
Comment #9
miccelito commentedSeems that a quick solution instead of doing overkill by installing extra not needed modules or changing code, could be to use Compact Forms module http://drupal.org/project/compact_forms
Where the only thing you need to do is to add the form id of simplenews and thereafter the label of the input.form-text field will be displayed within the input field, having same effect as a placeholder.
Comments are welcome if you agree or disagree with this solution...
Comment #10
Anonymous (not verified) commented