views:

2079

answers:

4

I'm new to Drupal 6.10 CMS and PHP too. I'm creating my website with drupal and I have found a module called Webform I like it, it's pretty easy to create forms with different types of fields and file uploading. The one thing that i can't figure out is how to add Rich Text before all fields. Something like introduction to the form. This module has "Description" field that will show text as a plain text but it doesn't have rich text in it.

What can I use to make that happen. Is it possible to hardcode html there or is there any other modules that can allow to do something like that?

Thanks

+4  A: 

the value of the "Description" field is passed through _webform_filter_descriptions(). this function has a $strict parameter, defaulting to TRUE, which determines if the description is filtered through filter_xss() or not. filter_xss() allows some html:

'a', 'em', 'strong', 'cite', 'code', 'ul', 'ol', 'li', 'dl', 'dt', 'dd'

so you can either restrict your "rich text" html to these elements, or modify _webform_filter_descriptions(), setting $strict to FALSE. if you do latter, be aware of the security implications (users with rights to create webform descriptions could enter malicious html - that's what filter_xss() protects against).

ax
A: 

I think all you need to do is set the 'input format' to 'full html' and then you can use whatever HTML/CSS tags you want to style the text.

A: 

You can achieve this by the creating a Form Component "MARKUP" from the drop down option when creating new fields.

From this part, you are able place html and php in this box as you desire.

You also have the ability to choose input format to have more control over how you want to work with this element.

zeropx
A: 

As the OP says, the "Confirmation" box shows up with the WYSIWYG editor toolbars, but the "Description" box does not.

The simplest way to deal with this is simply to handcode the HTML you want in the Description box. While nowhere does it say you can do this, you can, and it works.

Chris