Is there a way we can choose what field types are affected by this module? I want to have placeholders for text fields and text areas however I don't want it to apply to select fields.

Comments

tisteegz’s picture

Title: Don't want to apply to select options » Don't want to apply to select field
guschilds’s picture

Hey tisteegz,

To fix this now: If you're comfortable with using dev releases and implementing hooks in custom modules, there is a new hook in the dev release (and soon in the future 7.x-1.5 release) named hook_webform_hints_fieldtypes_alter(). This allows you to alter the list of supported fieldtypes. For example, you could do this:

function mymodule_webform_hints_fieldtypes_alter(&$fieldtypes, &$element) {
  // Don't let Webform Hints apply to select lists.
  $select_key = array_search('select', $fieldtypes);
  if ($select_key) {
    unset($fieldtypes[$select_key]);
    $fieldtypes = array_merge($fieldtypes);
  }
}

In the future: That hook was really made so people could add to the supported fieldtypes (doesn't hurt to use it that way, though). It may be helpful if we added a simple option to the module settings where you could turn off specific fieldtypes from those that are supported by default. What do you think?

tisteegz’s picture

Status: Active » Closed (fixed)

Hey guschilds,

Just got back onto this and your fix works perfect. Added bonus with it being in the stable version now ;)

Thanks!