form_clean_id() does not filter all invalid characters
blueyed - October 18, 2006 - 17:11
| Project: | Forms |
| Version: | HEAD |
| Component: | Code |
| Category: | bug report |
| Priority: | minor |
| Assigned: | Unassigned |
| Status: | needs work |
Jump to:
Description
I've just stumbled upon form_clean_id() (http://api.drupal.org/api/HEAD/function/form_clean_id) and it only replaces the string "][" with "-".
IMHO it should at least replace "[" and "]" separately.

#1
Forms and survey modules are no longer being maintained, use Webform module instead.
---Closing down issue queue of survey module---
#2
This issue is still unresolved for my clean installation of Drupal 6.14 + Webforms.
I used copy-pasted text for a "select" field, with string similar to "Wordpress-Template (+299 €)" without quotes. While the form works in Mozilla Firefox, W3C doesn't validate the exotic chars €)(. Additionally, the \t (Tab) character from copying went into the id as well, whereas when rendered in the Browser, the user can't see the difference from a ordinary space.
I post this here and not in the Webform issue tracker, as other module developers might also unwillingly create invalid HTML.
#3
See also http://drupal.org/node/189792 and http://drupal.org/node/464862, as they contain the more recent discussion on the topic.