Closed (duplicate)
Project:
Webform
Version:
6.x-2.7
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
10 Jul 2009 at 05:34 UTC
Updated:
9 Feb 2010 at 05:50 UTC
The select component is unable to provide a unique default select option for each component.
I've made a patch to populate the default select option form that components value. See attached patch.
Other ways to do this with out hacking the module would be to use form_alter, but I'm lazy and I figured all my other installs would use this too, so I patch the module. Hopefully we could get something like this into web form as I think many users would find it useful.
| Comment | File | Size | Author |
|---|---|---|---|
| components-select.inc_.patch | 606 bytes | j0rd |
Comments
Comment #1
j0rd commentedThis patch will not work. It will not allow to actually default the value of the field with something like %get['foo'].
My new solution will be to allow a blank key which will fail on "field required"
Example:
*OPTIONS*
|Default Option used to Describe other option
one|Option One
two|Option Two
three|Option Three
As mentioned about if this field is required, it should not allow a submit when the value of this select is set to "Default Option used to Describe other option".
Comment #2
quicksketchThe original suggestion was implemented in #598742: Mandatory select listbox has 'select...' option.