• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: "conditional" thank you message

"conditional" thank you message 10 years 9 months ago #28169

Hi,

I have a complex form in my site. For some reasons, I need the "Thank you message" be different, depending on a select field. I already use PHP to change the user email content depending on that field; but I don't know how to make the same for the thank you message.

To be clear (sorry for my bad english), I have a select field in the form, with 3 options : A, B and C. I the user selects A, I want the "thank you message AAA", if he chooses B, the "thank you message BBB", ....

How can I do that ? Can I just add code in the "thank you message" ? If yes, how to get the values selected ?

Thanks !
The administrator has disabled public write access.

"conditional" thank you message 10 years 9 months ago #28171

  • cosmin.cristea
  • cosmin.cristea's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 756
  • Thank you received: 144
You can build on the following example to fit your scenario :
if($_POST['form']['name_of_field'] == 'somevalue1'){
   $thankYouMessage .= 'This is the thank you message to be displayed when name_of_field is somevalue1';
   }
   else if($_POST['form']['name_of_field'] == 'somevalue2'){
   $thankYouMessage .= 'This is the thank you message to be displayed when name_of_field is somevalue2';
   }
else{
   $thankYouMessage .= 'This is the thank you message to be displayed when name_of_field is not on the others';
   }

Keep in mind, if the selection field is a dropdown you will have to use the following syntax :
$_POST['form']['name_of_field'][0]

More information on PHP scripts here:

www.rsjoomla.com/support/documentation/v...602-php-scripts.html
My help is not official customer support. To receive your support, submit a ticket by clicking here
The administrator has disabled public write access.

"conditional" thank you message 10 years 9 months ago #28212

That's work, thanks !

I can't use the OR php operator " II ", if I use them nothing works. I did it with "if...elseif...else..." so it doesn't really matter, but still I want to understand why I can't use " II " ?
The administrator has disabled public write access.

"conditional" thank you message 10 years 9 months ago #28213

  • cosmin.cristea
  • cosmin.cristea's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 756
  • Thank you received: 144
They should work, can you please paste the script you developed to see where it's going wrong?
My help is not official customer support. To receive your support, submit a ticket by clicking here
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!