This module allows users to enable automatic placeholders to textfields, textareas, select lists, and email fields within a webform created by the Webform module.

The placeholders provided by Webform Hints use the component's title and are applied on a per-webform basis. When the HTML5 placeholder attribute isn't available, this module grants optional legacy browser support using a jQuery Plugin fallback. Label elements are then hidden via .element-invisible to keep them available to screen readers. Required indications are also present and configurable.

Usage

After creating your webform, visit the Webform Hints administration panel to enable the Webform Hints functionality on the nodes of your choosing.

  • Drupal 7: admin/config/content/webform-hints
  • Drupal 6: admin/settings/webform-hints

Sandbox Project Page

https://drupal.org/sandbox/chrisfree/1128558

Git Repository

git clone --branch 7.x-1.x http://git.drupal.org/sandbox/chrisfree/1128558.git webform_hints

Ventral.org Review

http://ventral.org/pareview/httpgitdrupalorgsandboxchrisfree1128558git

Simplytest.me

http://simplytest.me/project/1128558

Reviews

Second Round of Reviews

Comments

PA robot’s picture

We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)

Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).

I'm a robot and this is an automated message from Project Applications Scraper.

medienverbinder’s picture

Hi!

Manual review:
- Install a fresh drupal 7.22
- Move the module package "webform_hints" to folder to sites/all/modules
(Suggestion: For the overview, I would put all the js files in a separate js directory)

- Move the module package "webform" to folder to sites/all/modules
- Enable webform (no problems found)
- Enable webform_hints (no problems found)

Suggestion: You can specify the path to the configuration already in the webform_hints.info file.
(https://drupal.org/node/542202)
(add "configure = admin/config/content/webform-hints" to webform_hints.info)

- Visit webform_hints configuration (no problems found)
- Save configuration (no problems found)
- Added Test Webfom Content (no problems found)
- Visit webform_hints configuration and apply webform_hints effect to Test Webform (no problems found)
- Edit Test Webform Content => got already shown filled text boxes
- The pre-filled text are also stored and displayed in submissions

Question;: If I set the fields to "Mandatory" the pre-filled text (placeholder) is not accepted if I want to save the form. If the function as intended?

Best regards.

chrisfree’s picture

Thanks for the review medienverbinder!

I've updated the module with the following:

As for your question regarding whether the form should allow submissions on fields where the value matches the placeholder, I believe this is the intended behavior. This module, however is not altering any validation rules.

Thanks,
Chris

jamiehollern’s picture

Chris,

I've had a look and I have the following points to make:

  • formHints.js comes included with the module and is released under Creative Commons Attribution 3.0 Unported (CC BY 3.0). However I'm not sure if this license is compatible with the GPL license. "Not sure" is the key phrase though; it may be okay as is but it's probably worth checking just to make sure. If not, perhaps you would need to utilise the Libraries module.
  • The module is categorised under "User Interface" but I was actually expecting this to appear under the "Webform" group. I see why you would put it where it is though, so I guess it's a judgement call.
  • This isn't an issue with the module; more of a feature request. It would be good to have the placeholder text as optionally customisable. So provide the default as the component title but also allow the user the option of adding a custom placeholder and being able to choose whether to hide or show the label.

I didn't come across any other issues though and this module is a great idea that fills an obvious gap in the Webform module's functionality. Great job.

chrisfree’s picture

Thanks for the review jamiehollern, very much appreciated.

After much research, testing, hair-pulling, etc., I ended up replacing the jQuery fallback plugin to another, found here: https://github.com/palmerj3/jQuery-Plugin---Form-Field-Default-Value

This plugin is using the MIT Sofware License, which is GPL compatible, see here: http://en.wikipedia.org/wiki/MIT_License

Coincidentally, this plugin also addresses a minor issue with older IE versions not clearing default/placeholder values on form submissions, so this ends up being a better solution on both fronts.

Regarding your suggestion on module categorization, I agree that this is probably a judgement call as it could fit in either category. I think most users would expect to find the module listed with Webform and other Webform modules, so I changed it: http://drupalcode.org/sandbox/chrisfree/1128558.git/commitdiff/32cb1423f... -- good call there.

Regarding customizing placeholder values, I think this would be a pretty great feature in the future. And coincidentally, this new plugin might actually be better suited to the task (depending on implementation). I'd prefer to get this module moved to official project status before adding that feature in, if possible. :-)

Additionally, I fixed a few issues that Coder was barking about. This should be ready for another round of review!

jamiehollern’s picture

Status: Needs review » Needs work

Chris,

No worries regarding the "feature" that I requested; I realise that it can wait until the next branch.

On the subject of licensing, I may have given you the wrong information regarding licenses. You might need to take a look at Why drupal.org doesn't host GPL-"compatible" code and also 3rd party libraries on Drupal.org. It seems that it needs to be GPL licensed code that's included, or else any code should be downloaded by the person installing the module.

Sorry to be a pain, but I'm not an expert on this!

Jamie

chrisfree’s picture

Status: Needs work » Needs review

Thanks Jamie,

I decided to rework the plugin support to be optional. Since it is really only needed for legacy browsers, I decided it shouldn't be a requirement to run the module. The latest commit addresses the following:

  • Adds Libraries 2.x as a dependency.
  • Adds proper library support for the Form Defaults plugin (solves licensing concerns once and for all)
  • Adds "Legacy Support" option to admin panel, this is what invokes the plugin when enabled.

I have few minor things to tweak, but I'd say this is ready for another review. Thanks so much!

Chris

kenianbei’s picture

Status: Needs review » Reviewed & tested by the community

Hi Chris,

I've installed Webform Hints and it works as expected out of the box. The module code is fairly straightforward and well written. I couldn't find any security risks.

Looking at the past comments, it looks like you've done a good job of addressing licensing and library issues. So I am tentatively switching status to RTBC, with some minor comments:

  • There already exists a form hint module that can be used with webforms: https://drupal.org/project/hint. It is more difficult to implement, so I think the argument for creating this new module could be ease of use and customizability. I think it would be great to add a settings page to each webform rather than having a global, admin centered settings form.
  • Running JSHint on found no major issues, but there was several 'Mixed spaces and tabs.' warnings.

Hope your module gets accepted!

Norman

chrisfree’s picture

Norman,

Thanks for the review and the bump to RTBC status. I'd agree that I think there is room for both modules here. Webform Hints is geared specifically toward Webform-provided forms and allows for easy config. Additionally, the approach here is to use HTML5 placeholders and only use the JS fallback if needed/required.

As for adding the ability to enable/disable Webform Hints on each webform, that's on the list of things to implement! I just pushed up a commit to fix the tabs/spaces issue. I've had this module lying around so long the code still had tabs in it! HaHa!

Thanks again,
Chris

chrisfree’s picture

Issue summary: View changes

Updating module description to accurately reflect changes made during review process.

chrisfree’s picture

Issue tags: +PAreview: review bonus

Finally completed 3 reviews of other projects. Adding "PAReview: review bonus" tag. Thanks for all the reviews everyone!

klausi’s picture

Status: Reviewed & tested by the community » Needs work

There is a git tag that has the same name as the branch 7.x-1.x. Make sure to remove this tag to avoid confusion.

chrisfree’s picture

Klausi,

I deleted those tags. Thanks for the review.

Chris

chrisfree’s picture

Status: Needs work » Needs review

Switching to "needs review" again. Thanks!

PA robot’s picture

Status: Needs review » Needs work

There are some errors reported by automated review tools, did you already check them? See http://ventral.org/pareview/httpgitdrupalorgsandboxchrisfree1128558git

I'm a robot and this is an automated message from Project Applications Scraper.

chrisfree’s picture

Status: Needs work » Reviewed & tested by the community

Fixed up all of the automated review issues. Moving back to RTBC. Thanks again!

klausi’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: -PAreview: review bonus +PAreview: security

manual review:

  1. webform_hints_init(): why do you need hook_init()? This will be loaded on every single page request? I think you should only execute that on actual webforms (i.e. in webform_hints_form_alter()), not globally on every page load.
  2. webform_hints_admin_settings(): The node query does not respect node access grants, thereby possibly exposing nodes that the person editing the admin form should not see (access bypass vulnerability). Either you respect node access grants in that query or you mark the permission necessary to get to that admin form as 'restrict access' => TRUE. See https://api.drupal.org/api/drupal/modules!node!node.module/group/node_ac... . This is a security blocker. And please don't remove the security tag, we keep that for statistics and to show examples of security problems.

Otherwise looks almost ready. Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.

chrisfree’s picture

Status: Needs work » Needs review

Just pushed up fixes recommended by klausi. Ready for review again.

chrisfree’s picture

Issue summary: View changes

Added 2 more reviews of other projects.

chrisfree’s picture

Issue tags: +PAreview: review bonus

Completed 3 more reviews, added to the initial issue post. Re-adding review bonus tag.

chrisfree’s picture

Issue summary: View changes

Added three more reviews.

klausi’s picture

Assigned: Unassigned » zzolo
Status: Needs review » Reviewed & tested by the community
Issue tags: -PAreview: review bonus

Looks RTBC now! Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.

Assigning to zzolo as he might have time to take a final look at this.

klausi’s picture

Status: Reviewed & tested by the community » Fixed

no objections for more than a week, so ...

Thanks for your contribution, chrisfree!

I updated your account so you can promote this to a full project and also create new projects as either a sandbox or a "full" project.

Here are some recommended readings to help with excellent maintainership:

You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and stay involved!

Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.

Thanks to the dedicated reviewer(s) as well.

chrisfree’s picture

Thanks klausi!

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

Anonymous’s picture

Issue summary: View changes

Add Ventral.org and Simplytest.me.