Active
Project:
Webform Term Options
Version:
7.x-1.1
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
20 Sep 2011 at 19:32 UTC
Updated:
13 Mar 2015 at 19:17 UTC
Jump to comment: Most recent
Comments
Comment #1
cafuego commentedUsing a vocabulary with multiple identical terms would break this. An example would be a vocabulary tree with geographical data, such as two regions or states that might each contain identically named towns. The term->tid would be different, the term->name would not.
Comment #2
acke commentedYes, using the term as a key is useful when there aren't multiple identical terms. So it should be optional.
Comment #3
cafuego commentedRather, the results should use a the tid as key, but optionally do a lookup to the term name.
Comment #4
Lensman commentedI have a webform that is submitting to a cloud service (Salesforce.com), but the form needs the term name not the tid, (for example in a salutation field: Ms., Mr., Dr., etc...) so I used the hack above.
This solves the problem for that case, but now I also need to create a country list the returns the two letter country code from a select list, but I'd like the full country name to be what the webform displays. Using a standard select list I can do this easily enough with the options as follows:
US|United States (US)
AF|Afghanistan (AF)
AL|Albania (AL)
DZ|Algeria (DZ)
AS|American Samoa (AS)
etc...
but I have a lot of forms that I would like to have use this list, so a taxonomy makes more sense, unfortunately the hack above would net me a select list that looks like:
US|US
AF|AF
AL|AL
DZ|DZ
AS|AS
I'm thinking it would be workable if I could have the select list optionally pull from term description the long form of the name. (Which I'm guessing would be a variation on the hack above) but I don't know PHP well enough to code that.
I think it'd also be nice if the returned key format was a selectable option from:
tid | Name
Name | Name
Name | Description
Comment #5
kyleheney commentedThe idea in #4 would be fantastic actually. It would allow for customizing the key for the list of terms.
For my use, I have a select list of Account Names. The corresponding key is the Account Number. By using the Select list like this, I'm able to reference the Account Number in an email based on the user's selection of the Account Name.
I'm looking at making this list of Account Names a Taxonomy since the terms are used multiple times on several forms. When changes are required (add new accounts, etc), I'd only have to update the Taxonomy vocabulary and all instances of the list would be updated.
It would be GREAT to be able to use this module and be able to customize the key values for each vocabulary. I'm at the same level as Lensman though, so I don't know PHP enough to know how to make this happen. Any help is appreciated.