Forums

[Solved] How conditions may applied to Drop Down boxes

raihan 03 Mar, 2013
Hi,
I have added a drop down box in my lightbox form, please have a look at: http://raihans.co.uk/homepage/contact-us. I wish to give if..elseif...else... condition for each of the selection. How I may do that, please?

Something like, if Customer Service will be selected - on Submit email will be sent to [email]cs@raihans.co.uk[/email], or if Technical Support will be selected email will be sent to [email]ts@raihans.co.uk[/email]. How I may do that, please - guide me.

I have tried one of your FAQ (How do I build a select drop-down group), as you suggest me for another post before. But, I failed.

Thanking you in advance.

Raihan
raihan 11 Mar, 2013
thnx Bob,
Sorry, a bit late to reply. I have tried the FAQ you suggest me. For some reason it's not working. I have tried to trace and I realized that the problem is in the line:
$form->data['email_to_use'] = $emails[$recipient]; /* [email]'ts@raihans.co.uk[/email]'; */
The value as assigned through recipient, is not entering as for the value of 'email_to_use'. The value of 'email_to_use' is just empty. Instead, if I use an email address directly, it's working. Don't know, probably something missing in this line, the value of array is not getting into the variable.
The value for recipient coming as: array ( 0 => 'em2', ), as I have selected 2nd option from 3.
The value for email_to_use coming as: [email_to_use] => , means just empty.
Could you please have a look, what's may be wrong.
Thanking you.

Raihan
GreyHead 12 Mar, 2013
Hi Raihan,

It sounds as though you haven't matched up the Custom Code with the input names from your form. There's not enough information here to say anything more helpful.

Bob
This topic is locked and no more replies can be posted.