Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I have a few selections in a form that require trademarks (™) and copyrights (©) and when i have those in the selection, i'm not able to submit the form with those selected.
Comments
Comment #1
quicksketchCould you be more clear about what you mean by "selections"? If you mean a select list, you shouldn't use the the HTML entity when setting up the field. Just use © or ™ directly in the list of options.
Comment #2
sorahn CreditAttribution: sorahn commentedI'm trying to add them as selectable in a checkbox list "select". And i what do you mean by just use © / ™ directly? just copy it from another page and paste it as the result of the symbol?
I didn't even try and see if an ampersand works, but shouldn't html entities in general work? what if i wanted a list opion with a <?
Comment #3
quicksketchSorry, what I meant was you shouldn't use HTML entities at all. Webform will handle converting any special characters to their HTML entity equivalents. So if you need to create © sign, use the appropriate method for entering that symbol just as you would in a word processor.
Note there's currently a bug with
<>
characters in Webform select lists in that they don't show up at all as they're stripped out by the HTML filter. Other characters should work fine though.Comment #4
quicksketchI'm moving this to fixed, if you still have troubles with inserting special characters please reopen.
Comment #6
TrevorG CreditAttribution: TrevorG commentedAfter spending days troubleshooting a form, I have solved my issue. It was giving me the error "An illegal choice has been detected. Please contact the site administrator." if I used all of the components of the form, whether I marked them mandatory or not. At first I though it might just be that mandatory selects were the problem because occasionally I would actually get a form through, after I had deselected mandatory from the selects and didn't tick any options when filling out the form... but it turns out the problem was with a couple of the actual select components, or more appropriately the characters in the options.
After looking in the log I finally found what looked strange: the apostrophe symbol ' was not being converted correctly on "select" items. It was showing as /' in options selected. I believe this was throwing the form API for a tiff because there is no actual option that includes /' . I understand that in PHP it is necessary to escape characters to have them display correctly, so this is probably why it was used.
After looking further, and attempting to replicate it seems that it is limited to only selects with multiple enabled that has options that are selected which have apostrophes. Selects with multiple enabled that don't have an option with a apostrophe selected are unaffected.
Suggestion: Check the code for multiple selects and see whether the apostrophe is being escaped correctly.
I should say that this was in all browsers and using the latest 2.x and 3.x dev versions.
Sigh... if I could just have those two days back.
Comment #7
SeanA CreditAttribution: SeanA commentedMarking this as fixed again, since the apostrophe problem is a separate issue, see #354240: Answers in select fields not accepted if questions contain apostrophe AND the field accepts multiple answers.