How easy is it to have a different recipient for a Form depending which Radio button is checked?
freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options
How easy is it to have a different recipient for a Form depending which Radio button is checked?
freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options
That depends entirely on how you are handling the form on the server
side. Which form handler are you using, and in what language is it
written?
Walter
On Apr 5, 2011, at 1:04 PM, Kryten wrote:
How easy is it to have a different recipient for a Form depending
which Radio button is checked?
freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options
freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options
Ah thanks Walt. I’m using out of the box PHP Form feedback Action on David Owen’s servers. I hope your reply is in English.
K.
freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options
Or put another way:
PHP表單在大衛歐文的服務器上的反饋活動
freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options
Whew. I thought I’d need to break out my Martian thesaurus!
I posted something here to do this very trick at least a year ago.
I’ll see if I can find it.
Walter
On Apr 5, 2011, at 1:14 PM, Kryten wrote:
Ah thanks Walt. I’m using out of the box PHP Form feedback Action on
David Owen’s servers. I hope your reply is in English.K.
freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options
freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options
I added something like this in the latest version of the Action - 2.3.7. I’ll upload it now…
Done.
In with the original PHP Feedback Form Action is another Action called “PHP Feedback Form Recipients List”. Simply apply this to a standard menu list item which contains the departments and email addresses and the main Action pulls integrates them into the form processing script.
In Freeway the format for the menu content should be;
Choice: Sales
Value: (the sales email address)
Choice: Support
Value: (the support email address)
etc. etc.
The upshot is that the user can select a department to contact via the form and their email addresses are safely hidden in the -go.php file.
Here’s an example of a very simple finished form; http://www.freewayactions.com/test/php-feedback-form-recipient-list/
You can download the updated Action from either here;
http://www.freewayactions.com/product.php?id=019
or there;
http://www.actionsforge.com/actions/view/160-php-feedback-form
When I get a second I’ll add an example to the FreewayActions.com product page.
Regards,
Tim.
On 5 Apr 2011, at 18:04, Kryten wrote:
How easy is it to have a different recipient for a Form depending which Radio button is checked?
FreewayActions.com - Freeware and commercial actions for Freeway Express & Pro.
…
Protect your mailto links from being harvested by spambots with Anti Spam.
Only available at FreewayActions.com
…
http://www.freewayactions.com
freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options
Tim - thank you. I will try and make head or tail of this and if I get stuck, which I probably will, I’ll be back in touch. Thanks again Gentlemen.
K.
freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options
I found the link, but it was to someone asking about how to include a reply-to-sender feature, and Tim has already added that to the core of the Action. But you can use the same trick to send the same form to one of N different recipients, without revealing those e-mail addresses to the slimy world. Yes, you will have to paste in some PHP. But you will only have to paste it into the Action palette, and it won’t hurt very much.
"; $r = array('bob(a)example.com','norm(a)example.com'); $recipient = $r[$_POST['destination']]; $recipient .= "
Paste the above into a text editor first, and update the array to include all of the e-mail addresses you want to offer to your site visitors. Note that (if you’re looking at this in Mail) I used the (a) notation (lower-case a inside parentheses) to fool the Web formatter into not masking the addresses. You would want to enter your actual e-mail addresses. PHP array notation is simple: inside parentheses, enclose your values within single-quotes, and separate them from one another with commas.
Whatever order you enter these in, pay attention, because those will need to be added to your form page in the same order. Once you have all the addresses in place, copy it back to the clipboard, go into the PHP Feedback Form interface in the Actions palette, and paste the whole long string into the Recipient field. (Make sure to clear out anything that’s in there by default first.)
Now, on to the only other part that requires any care. You want to provide a way for senders to choose one recipient, so you would create a set of radio buttons. I’ve named this ‘destination’ in my code, so you should do the same. (Remember, set this in the third tab from the left in the Inspector, in the Name field. In the Value field on that same tab, enter 0 through the number of addresses you have - 1. (Arrays are numbered 0, 1, 2 rather than 1, 2, 3.) Remember the order of addresses you created in the code – these just have to match up. So if you were making my form, you would end up with:
<input type="radio" name="destination" value="0" /> Bob Vila
<input type="radio" name="destination" value="1" /> Norm Abrams
Just put those radio buttons in the same form that PHPFF is handling, and that snippet of PHP I pasted above will do the rest. Because this stays in the PHP realm, you will never reveal the e-mail addresses to the public, only the meaningless numerical index of the address (0 or 1 or whatever).
If for some reason this does not work, check to see if you have the Encode E-mail Addresses option set in Freeway’s Document Setup. If you do, it may be encoding the values you set in the Action. Turn it off – you’re using this form so you don’t need that anyway.
Walter
freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options
Oh, nicely done!
Walter
On Apr 5, 2011, at 1:54 PM, Tim Plumb wrote:
I added something like this in the latest version of the Action -
2.3.7. I’ll upload it now…
Done.
freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options
I added something like this in the latest version of the Action - 2.3.7. I’ll upload it now… Done.
I was just about to post a link to Walters version - which I have been using - thanks Walter.
And then this arrives.
You guys spoil us with these little extras! Much appreciated.
David
freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options
You guys spoil us with these little extras! Much appreciated.
SHHHHHHHH!
freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options
Genius Tim. Thanks very much. Walt thanks also. Very helpful as usual.
One question though Tim: in the Form setup under Hidden/Recipient etc, should this be left blank now as your Action contains the 2 email addresses I need?
K.
freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options
Hi Kryten,
You shouldn’t need anything in the form setup as the PHP Feedback Form Action will set that up for you. The new recipients list Action simply extracts the recipient email addresses and replaces them with IDs. When the script gets a request to sent the form data to a specific ID it looks up the corresponding user and sends them the email.
I hope that clears things up a bit.
Regards,
Tim.
On 6 Apr 2011, at 09:41, Kryten wrote:
One question though Tim: in the Form setup under Hidden/Recipient etc, should this be left blank now as your Action contains the 2 email addresses I need?
FreewayActions.com - Freeware and commercial actions for Freeway Express & Pro.
…
Protect your mailto links from being harvested by spambots with Anti Spam.
Only available at FreewayActions.com
…
http://www.freewayactions.com
freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options
Thanks Tim, really helpful. What about the Required email address in the PHP FF Action palette though? Is this overridden?
K
freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options
Yes, this (required) value is simply ignored if the recipients list action is used.
Regards,
Tim.
On 6 Apr 2011, at 14:37, Kryten wrote:
Thanks Tim, really helpful. What about the Required email address in the PHP FF Action palette though? Is this overridden?
FreewayActions.com - Freeware and commercial actions for Freeway Express & Pro.
…
Protect your mailto links from being harvested by spambots with Anti Spam.
Only available at FreewayActions.com
…
http://www.freewayactions.com
freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options
Really helpful Tim, thanks to all who responded. If only everything was this simple.
K
freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options
This thread explains the Recipients List Action with a brief overview on how to set it up;
http://freewaytalk.net/thread/view/88692
Regards,
Tim.
freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options