make a form with the choice of the recipient according to the subject

  • jackminv
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 5
  • Thank you received: 0

jackminv created the topic: make a form with the choice of the recipient according to the subject

Hello,
I would like to make a form under Joomla with the choice of the recipient according to the subject.
So I created a field (obligatory field with FF::ff_valuenotempty) with a selection list:
1; Thank you to make your choice in the list;
0; subject 1; admin@xx.fr
0; subject 2; info@xx.fr
0; subject 3; purchases@xx.fr
Then, in the advanced part of the field, in the Action Script section, I checked the box "Modify" and I put the following code:
function ff_selectlistname_action (element, action)
{
if (element.value == "subjet 1") {
ff_getElementByName ( "recipient_selection") value=admin@xx.fr.
}
else if (element.value == "subject 2") {
ff_getElementByName ( "recipient_selection") value=info@xx.fr.
}
}
else if (element.value == "subjet 3") {
ff_getElementByName ( "recipient_selection") value=achats@xx.fr.
}

} // ff_selectlistname_action
"recipient_selection" being the name of the field of my form.

But it does not work and I don't find solution on the forum, can you tell me a solution?
Thank you in advance.
Jack
#236497
  • Posts: 2461
  • Karma: 86
  • Thank you received: 333

mihaela replied the topic: make a form with the choice of the recipient according to the subject

Hello,

Your code does not work because what is saved as the "element.value" for the select list is the value of the option which is selected.
In your case, options values are " admin@xx.fr", " info@xx.fr" and " purchases@xx.fr".

Therefore, either you have to change the list to look like this:
0; subject 1;subject 1
0; subject 2;subject 2
0; subject 3;subject 3
or you need to change the code.

The simplest solution is that you don't create an additional "recipient_selection" field in your form and that you just check the Mailback checkbox in the Advanced properties of the select list element. If you decide to use this way leave the select list defined as it is now.

That way, a mailback email will be sent to the email address depending on which subject is selected.

Regards,

Mihaela
#236498
  • jackminv
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 5
  • Thank you received: 0

jackminv replied the topic: make a form with the choice of the recipient according to the subject

Hello Mihaela,
I tried to follow your instructions by making variants but I can not do anything!
I made screenshots of the BreezingForm admin so that you can see what I did and if possible advise me.
Thank you in advance.
#236499
Attachments:
  • Posts: 2461
  • Karma: 86
  • Thank you received: 333

mihaela replied the topic: make a form with the choice of the recipient according to the subject

Hello,

I see where the problem is. You have few errors.

In the Actionscript code, you define values for "recipient_selection" field, but you don't have a textfield in your form named that way.

So, what you should do is you should create a Textfield named "recipient_selection" and in the Advanced properties check the Mailback checkbox.

Also, in the code, make sure to remove typos regarding "sujet", "subject" and "subjet", put "sujet" everywhere since you've defined the list that way.

Let me know whether that resolves the issue.

Regards,

Mihaela
#236539
  • jackminv
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 5
  • Thank you received: 0

jackminv replied the topic: make a form with the choice of the recipient according to the subject

Hi Mihaela,
Thank you for your feedback.
I followed your instructions and unfortunately it still does not work. The form blocks and does not send anything :(
I made screenshots of the form's configuration.
Thank you again for your help.
Jack
#236566
Attachments:
  • Posts: 2461
  • Karma: 86
  • Thank you received: 333

mihaela replied the topic: make a form with the choice of the recipient according to the subject

Hello again,

From what I see you haven't added the NEW textfield to your form named "recipient selection" which should be filled in with the email address. In Advanced properties of that NEW field, the Mailback checkbox should be checked.

I still think that what is explained here crosstec.org/en/support/online-documenta...ifferent-emails.html is the simplest solution for your case.

Regards,

Mihaela
#236599
Moderators: ForumSupporttomeperica
Time to create page: 0.177 seconds

New Icon Packs Category!

Crosstec is now offering icon packs.

If you are a paying subscriber, icon packs are automatically added to your account.

Check out our icon packs page!

Live Support Chat Opened!

Join our Discord chat here to receive live support and talk directly to the team!

Summer Sale!

50% discount on all of our extension subscription plans, templates and icon packs!

Get Your Subscription Here

News and Updates

Get informed about new downloads, updates and more in our News and Updates newsletter.

All Extensions Subscription

Get 1 year access to all of our current and future products and 1 year of professional support -- 99 for just 49! (Summer Sale)

No support per domain or website installation limits! Includes all of our current and future Joomla!® extensions, Joomla!® templates for the duration of your membership. This means, by purchasing an All Extensions Subscription you'll have it all covered!

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!

Live Support Chat Opened!

Join our Discord chat here to receive live support and talk directly to the team!

Community Reward

Help us to create new extensions and plugins! With only $5 you help us a lot and get unlimited download access to all of our products, professional support and even more. Get your reward now!

Read More Here