Adding html tags to a webform

m@rtijn - November 3, 2009 - 15:59

Hello,

I'm trying to copy the following webform: http://www.ixis.co.uk/ (at the bottom)
In order to get the Your name field, the Your email address field and the Telephone field on the left side of the Enquiry field I need to put some div tags in the form. If the div tags are in place I can float theme to the left using CSS. But I can't figure out how to get those div tags in the form.

I already looked into webform-form-[node-id].tpl.php, but I can't figure it out. I tried something like this:

print "<div class=messagefields>";
print drupal_render($form['submitted']['name']);
print drupal_render($form['submitted']['email']);
print drupal_render($form['submitted']['telephone']);
print "</div>";
print "<div class=messagebody>";
print drupal_render($form['submitted']['enquiry']);
print "</div>";

Am I on the right track or do I have to look at something entirely else?

Thx

Web form block

ishmaelsanchez - November 4, 2009 - 04:37

You should use this module, http://drupal.org/project/webformblock. Create a node add and the HTML you want then add the web form block.

I know, but it doesn't work.

m@rtijn - November 4, 2009 - 08:41

I know, but it doesn't work. When I add a new webform and mark Generate a block, there is no block created. It's my second installation in which it doesn't work.

The webform needed to be

m@rtijn - November 4, 2009 - 09:17

The webform needed to be published in order to see the webform block (http://drupal.org/node/575636). I will try to theme this block.

Getting the webform in a

m@rtijn - November 4, 2009 - 09:40

Getting the webform in a block isn't the problem. I used to do it with views, now with webform block. I want to add html tags within the form, no around it.

Nobody?

m@rtijn - November 10, 2009 - 10:49

Nobody?

I would also like a solution

leandra - November 20, 2009 - 21:27

I would also like a solution to this problem. I am trying to apply javascript to a webform but need to add a few div tags within the form itself to make the conditional questions appear and disappear. Help?

 
 

Drupal is a registered trademark of Dries Buytaert.