Active
Project:
Hint
Version:
7.x-1.2
Component:
Documentation
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
9 Apr 2013 at 21:52 UTC
Updated:
10 Apr 2013 at 14:06 UTC
Hi, I'm already succesfully using Hint on search and login forms. Now I'd like to enable it in exposed filter forms of my views.
I tried this code in a new module "filter_hint":
function filter_hint_form_alter(&$form, &$form_state, $form_id) {
if($form_id == 'views_exposed_form'){
if (isset($form['#info'])) {
foreach ($form['#info'] as &$form_element) {
if (isset($form_element['label'])) {
$form_element['#hint'] = $form_element['label'];
unset($form_element['label']);
}
}
}
}
}All I obtain is that labels disappear (becouse of unset), but hint is not displayed, the hidden input is not created and there's no "hint" class in text inputs.
What am I missing?
Comments
Comment #1
nessunluogo commentedGot it!
I noticed that exposed filter's forms separate the information part (into the [#info] branch of the form array) and the settings (outside).
This is the code where I use an alternative solution to hints for select elements, renaming the "All" option with the label text.
It's still raw and may not work, but I hope this could help someone.