View Full Version : using radio buttons to determine who receives the email
sandy170299
03-24-2009, 07:34 AM
I currently have a couple of contact forms that are built in ColdFusion that contain radio buttons which determine who receives the emails. The client is now requesting a CAPTCHA. Because there is nothing that I am aware of out there that includes a CAPTCHA with any kind of ColdFusion form builder, I usually end up building my own. I am considering migrating these forms to PHP and using the Contact Form Solution Pack with the built-in CAPTCHA, but I know I will not be able to figure this one out myself, as I am not a PHP programmer. Is there an example anywhere on the WA site that could point me in the right direction? The fields used will be very standard, but the radio buttons determine who receives the emails, and not knowing PHP, I'm going to have trouble.
Ray Borduin
03-24-2009, 08:04 AM
Use php if possible... it is easier and more similar to CFML than you think, so don't be afraid.
1) Start with the contact form solution pack and get it working.
2) Then add the radio buttons and get them looking the way you want
Then you will be ready to tie the radio buttons into the email from field. This won't be too difficult, but I suggest you post back here once you have the first two steps completed and it will be relatively easy to give you the line or two of code you need to get the rest done.
sandy170299
03-24-2009, 11:09 AM
Here is the link to my PHP form so far: http://www.readexresearch.com/request-information.php. I'm having a couple of problems. All fields are required, and that's working, but the CAPTCHA field is not completely working. It will accept any value as long as it's not empty, and I'm sure that has something to do with me screwing something up in the validations :)
Now, for each radio button options, the emails need to go to multiple recipients, different multiple recipients for each radio button value.
I've done this through code with ColdFusion, but do not have a clue as to how to do it with PHP. This is my first real PHP form.
Thank you for your help :)
Ray Borduin
03-24-2009, 02:46 PM
It appears your server validations aren't on the page properly. They make the captcha validation work.
You can probably just set the email addresses as a semi-colon separated list. Then use the radio button posted value as the to address.
sandy170299
03-25-2009, 05:50 AM
Thanks, Ray. I've already written in the code in ColdFusion to determine who receives the email based on the radio button selected. Unfortunately, I need to get this done this morning and I'm just having too much trouble with the PHP conditional statements and the syntax to give this any more time right now. I'll probably just end up building the captcha myself again. Between now and next time this comes along, I'll try to work on my syntax. Thanks for the advice...
vBulletin® v3.8.1, Copyright ©2000-2012, Jelsoft Enterprises Ltd.