Forums

CF 7 - Alternate Data Set

pgrnycomdir 09 Oct, 2023
I use Alternate Data Set to provide email settings when particular choices are made to a radio group.

I now have an issue where I need to have more than one email address for the one of the selections. I have tried to put a space in between listing the two email addresses. I have also tried a comma, and neither of these work.

Can someone please help? I am a volunteer and NOT a programmer. I could really use some help.

I am not planning on switching anytime soon to CF8. I've just gotten all my forms working in CF7 and need to first upgrade to Joomla 4.x.

Thank you in advance.
Donna
Max_admin 10 Oct, 2023
Answer
it's not possible to set an alternative multiple values, you may use PHP for these values, use this code to set the value to an array:
$this->data["field_name"] = ["1", "2","3"];
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
pgrnycomdir 10 Oct, 2023
Max,

This is great, but where do I put it? This is why having a manual would be great. You could sell so much more product if you made it easier to understand. There are a lot of us out there that love the product, but since no manual we are lost.

$this->data["field_name"] = ["1", "2","3"];

Where exactly do I put this? Is it someplace in the form? Is it in the actions section? Where??

Thank you in advance.
Donna
Max_admin 12 Oct, 2023
you put this code in a PHP action, and place the PHP action at the top of the "submit" page.

But you need to put an if statement around the code to match the value you want to change:

if($this->data("field_name") == "xxx"){
$this->data["field_name"] = ["1", "2","3"];
}
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
pgrnycomdir 12 Oct, 2023
Max,

Thank you so very much. I will give this a try. Believe it or not I am learning from all of you and the forum!!

Best regards,
Donna
You need to login to be able to post a reply.