Hi,

I've posted an issue before on the select box and I hope it's ok I opened a new topic. I need a feature/add-on for this module. I'll first explain the problem;

If I add a form component 'select' I can add pipe separated key-value pairs. Yet because these pairs are turned into a array double keys will be removed. For instance, I want people to select what make car they have. According to their selection the form will be sent to the appropiate recipient;

dodge@domain.com|charger
dodge@domain.com|grand caravan
dodge@domain.com|viper
ford@domain.com|mustang
ford@domain.com|taurus
ford@domain.com|explorer
toyota@domain.com|camry
toyota@domain.com|prius
toyota@domain.com|rav4

If I do this the selectbox that I end up with will only show the following options;

dodge@domain.com|viper
ford@domain.com|explorer
toyota@domain.com|rav4

I need a solution to this. And while I'm at it I might as well request some more features :-)

- It would be nice if the value of the selection would also be send, so if one were to chose 'viper', the email sent to dodge@domain.com would also display the choice viper.
- When creating a form you have an option 'E-mail a submission copy' which I ofcourse use, yet this option will cause the email address used as a key|pair value to be coded into the HTML output. Which is ofcourse a feast for email harvesters! Isn't there a way to obscure these email addresses like the regular core contact form does?

I'll have to talk with my client about this but there might be budget available for it. Ofcourse it would be nice to know an estimate.

Regards

Comments

quicksketch’s picture

Marked #275297: Form component > Select > List box - KEY|Value values filtered for double entries??? as a duplicate. I'd be interested in implementing this feature, as in the 2.x version, a lot more people will be using Webform for contact forms now that conditional e-mail recipients is a lot easier than it was in the old version.

I imagine this feature working by adding a checkbox to the select.inc component: "Hide select keys", or something similar. This would cause webform to "protect" the e-mail addresses by just using numeric keys instead, regardless of what's in the list of options. After submitting, the keys would be converted back into e-mail address (or whatever their original values). A side-effect of this (and the original request) is that duplicate keys would be allowed.

ericclaeren’s picture

I could use a feature like this also, but it's important that you could use multiple key values, also these values needs to be incorporated into the form results and could be used as conditional addresses. The problem is that webform uses the key value as an array reference id. It would be better to use a different key value.

Maybe like this??

[name:reference1][key:one@domain.com][value:Office 1]
[name:reference2][key:one@domain.com][value:Office 2]
[name:reference3][key:two@domain.com][value:Office 3]

or the current structure

reference1|one@domain.com|Office 1
reference2|one@domain.com|Office 2
reference3|two@domain.com|Office 3

bartezz’s picture

Hi Dreamlabs,

Looks like we are looking for the exact same functionality. If I understand correctly that is.

I don't understand the 3 piped variables tho. I wouldn't know how to do it but theoretically I think this might be an idea;

- Add settings checkbox to a form component "select" when using "Conditional e-mail recipients" for a setting; "use value in form results instead of key"

Normally when using conditional e-mail recipients the choice a user makes is only used a a variable for sending email. For example a user picks Office 1.
Then webform would send the form to one@domain.com. But the variable Office 1 is lost. With a checkbox like described above, webform could use the
key one@domain.com as recipient and the value Office 1 in the email itself.

- Add settings checkbox to a form component "select" to prefix all key values
If all key values would be automatically prefixed with a number and some kind of separator before outputting the form then multiple identical keys can be
used without problems. For instance
0%%one@domain.com|Office 1
1%%one@domain.com|Office 2
The when a user presses send webform would remove the added prefix and send the email to one@domain.com

- A very nice but option which isn't necesary to make the above work is to obfuscate the key values so that email harvesting bots won't find the email addresses.
Don't know for sure but a simple encryption/decryption function could make this work.

The project I was requesting this for has been put on hold so it looks like there won't be funding for it anytime soon from my side.
Maybe Quicksketch still is interested in supplying this functionality anyway since I reckon it might be useful for more webform users.

Cheers

sebastyuiop’s picture

I also need to do this... for instance on a list of countries... I would like to have UK and USA at the top, then in alphabetical order further down the list. I have tried doing a form alter but the duplicate array keys just get stripped out... I don't mind hacking core if need be! Can anyone help, thanks?

quicksketch’s picture

Status: Active » Closed (duplicate)