Active
Project:
Hint
Version:
6.x-1.0
Component:
Documentation
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
16 Oct 2009 at 21:59 UTC
Updated:
30 Mar 2013 at 19:21 UTC
Jump to comment: Most recent
I really like the idea of this module.
Is it possible to use this module with webform?
Comments
Comment #1
quicksketchYou can use this module with Webform by theming any Webform (as is documented in the THEMING.txt file that comes with Webform). Then add the #hint property to any textfield (as is documented in the README.txt file that comes with Hint). I don't anticipate building direct support for Hint into Webform however, since generally it is not suitable for long forms that are of the Webform nature.
Comment #2
gthing commentedI've read over your comment and through both the readme.txt from Hint and the theming.txt file from Webform. I'm lost.
Is there a tutorial for doing this somewhere? I can't even get webform-form.tpl.php to work, let alone breaking out the different elements of the form, let alone figuring out how to "set $element[#hint']."
I know webform can be used for long forms, but people seem to use it for short forms (like quick contact in the sidebar or something). It's already provided by a block (which seems to accomodate short forms), it would really be nice if there was a checkbox on each field for "clear on click." Trying to integrate Hint into webform seems to require super leet programming skills.
Comment #3
gthing commentedI was able to achieve what I wanted using the Compact Forms module. Very easy to use and works like a champ: http://drupal.org/project/compact_forms
Comment #4
nvisioncurtis commentedHi There,
I was reading this post and I think you were refering to something I am tryijnjg to do... getting the compact form module to work with webforms...
It does not seem to work for me however, is there a trick?
Comment #5
quicksketchComment #6
tomseeber commentedHi All, Hi Quicksketch,
I did try out the instructions as listed here, if I did something wrong, I would love to understand where I misunderstanding.
First, as per web form documents, I was able to create a custom template for a webform node.
For me this was be webform-form-5.tpl.php and was able to make changes to that appeared in the form.
The Hint module was enabled and working in other places.
In this web form I have a webform field called "Testing It"
Using my understand of the method described in the Hint Readme File, I added the following code
dpm($form['submitted']['testing_it']['#title']);
unset($form['submitted']['testing_it']['#title']);
$form['submitted']['testing_it']['#hint'] = t('Testing It');
dpm($form['submitted']['testing_it']);
Which seemed roughly equivalent to the hook_form_alter method ( although again please let me know if this assumption is not correct).
I added the dpm's so I can just see exactly what was in the title for a webform entry.
I tried this also with the hint_set_hint($form['submitted']['testing_it'], t('Testing_it'));
(This is listed in the documentation as texthint_set_hint, but that throws an error). The hint_set_hint adds a #hint to the form just fine however.
This was followed by the normal Webform drupal_render[$form]
In both cases the #hint was part of the listing for the form field as I expected.
Upon flushing the cache, this does not seem to do anything.
Should I render each part the form separately although I can not see how that would make a difference ( and how would I do that).
If I thinking wrong on this, please by all means let me know what I am misunderstanding by your instructions, Quicksketch. I'll gladly write up a longer How-To documenting exactly how to do this, if I get this working.
Comment #7
Cristobal Wetzig commentedHope this helps someone, this changes all webform texfield inputs to use Hint (Uses the title)
Comment #8
RMani commenteddid not work :(
Comment #9
Anonymous (not verified) commentedHave you tried unsetting the default values?
Comment #10
hhopkins commentedI had to make a slight modification to #7 in order make it work for me. The hint_pre_render function needed to be added to each field in order to execute the hint process. Here is my code.
Comment #11
hmartens commentedIn which file would I add this to?
Thanks for the help!