Hi,
I'm using a pre-built option list on a webform, which generates the following:
cubs|cubs
scouts|scouts
rainbows|rainbows
brownies|brownies
etc
(If you need to know, I wrote a mini module which creates the pre-built option list from my database on page-load)
I want to pass in the default value via /MyForm?group=scouts which will set the option list to scouts when the webform is displayed.
I know I can click the radio button on the edit page for the component, and I know I can use %get[group] to retrieve the group and display it in a textfield etc, but is there a way (or can there be a way) to set the default radio item to %get[group]?
I didn't set this issue to 'feature' request because I wasn't sure if the facility already existed; feel free to change it if necessary.
Peter
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | options_element_pattern.patch | 6.91 KB | quicksketch |
| #2 | webform_options_element_token.patch | 517 bytes | quicksketch |
| #2 | form_builder_webform_token.patch | 1.41 KB | quicksketch |
Comments
Comment #1
quicksketchI saw a similar issue in the Webform queue but I can't find it at the moment. Apparently Options Element does not provide any way to use a default that is not in the list of options. You can try to switch the Options Element to "manual" and enter in the token %get[group], but then when saving the component in Webform the default value is lost. My guess is that Options Element is discarding this "invalid" option.
Comment #2
quicksketchThis issue is going to take a trio of patches to fix. One in each of options_element, webform, and form_builder. Combined, here is a set of patches that will finally take care of this issue.
Comment #3
quicksketchI've committed this to all the projects, for both D6 and D7. Combined, the required versions will be (when released):
Options Element: 1.5
Form Builder: 0.10 (or 1.0 versions)
Webform: 3.16
It may take a while for all these versions to be released, but the functionality is at least in place now. To use, you still have to click "Manual entry" and enter in the token manually, but at least the value will not be wiped out by Options Element and stay there as long as any other default values are not set.