Hi,

I want to create a little "Support" link in the header. Very similar to what Wordpress dashboard has (used to have). When people click it, it expands and becomes a contact form with only a single field (no "Your name", no "Title" -- just the e-mail body). People can immediately write about the problem that they're having and click "Submit issue", and once the e-mail is sent off the form will collapse back up.

How can I achieve something like this?

The first instinct is to use Form Block and some sort of a Collapsiblock, and maybe some Ajax-submit. But then the question is how do I handle the 1-field e-mail? Should I use Webform module (I don't want to inflate my database with support issues, I just want a simple e-mail to be sent out with an automated title "[sitename.com - Support request]").

Any ideas as to which modules I could use?

Comments

chrisshattuck’s picture

Since this seems like a really simple AJAX form, there are two options that come to mind.

First, you might want to explore AHAH. I know there's a way to process a form via AHAH, and it's just a matter of adding the right property. However, after spending a couple minutes looking it up, I wasn't able to find what that is. It's pretty simple though, from what I remember.

Secondly, you could just use some vanilla jQuery ajax to submit the form and hide it (that's something I've done in the past). If you do that, you should understand how to filter content using check_plain and adding tokens via drupal_get_token, to improve the security of the form.

Good luck!

Learn virtually any aspect of Drupal on BuildAModule, where I've recorded over 2200 video tutorials.

rburgundy’s picture

Hi Drupal Community-

I am also interested in this feature.
Were you able to find the right code and if so could you please share?

Thanks!