Hello and thank you for this module, when the economy gets out of the tanker I'm going to donate some money to you because you're module helps my business work.

So what I'm trying to do is to strip out any HTML tags that users put inside of a field. I have a few mini modules that modify your great module so if you can lead me in the right direction I think I can figure it out from there.

Thanks! Lee

Comments

quicksketch’s picture

Which fields are you trying to remove HTML from? I think webform let's you use HTML in the following places:

- All field descriptions (help text)
- and Markup components (of course)

So are we only dealing with the description field?

Alternatively, I might be misunderstanding and you're referring to the values entered by the end-users of the site (those filling out the form), instead of the user actually building the form. In that case, which fields are you filtering?

Grimlock’s picture

Thanks for the reply,

I'm referring to the person building the form, specifically inserting HTML into the Name field when creating a textfield, select list, or text area (Which are the only components I use). Here's how to reproduce the problem.

1. Create new webform, fill in node default info and submit

2. Edit the node and click the Components tab

3. In the name field put in HTML, for example insert "<img src="http://www.google.com/intl/en_ALL/images/logo.gif"> Google's logo" and click the Add button.

4. Leave the defaults as they are and click the Submit button.

5. The image will now show up on the components preview page and will show up in the form in the frontend when published.

I would like to strip out all HTML from the name field so people can't put anything but text in the name field.

Thanks Lee

Grimlock’s picture

No rush but I was wondering if there was an update on this? Could I some how use the strip_tags function? I'm not sure how to access apply it to each label however.

Thanks

quicksketch’s picture

The restrictions on tags in form element labels is defined by theme_form_element. I would suggest overriding it and replacing the call to filter_xss_admin() with check_plain().

quicksketch’s picture

Status: Active » Closed (fixed)

Oh dear, this was over a year ago. Closing after lack of activity. Reopen if you have further questions.