TOPIC:

make a form with the choice of the recipient according to the subject 1 year 1 month ago #236497

  • Topic Author
  • jackminv
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 5
  • Thanks: 0
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

Please Log in or Create an account to join the conversation.

make a form with the choice of the recipient according to the subject 1 year 1 month ago #236498

  • mihaela
  • Offline
  • Developer
  • Developer
  • Posts: 3128
  • Karma: 105
  • Thanks: 413
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

Please Log in or Create an account to join the conversation.

make a form with the choice of the recipient according to the subject 1 year 1 month ago #236499

  • Topic Author
  • jackminv
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 5
  • Thanks: 0
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.
Attachments:

Please Log in or Create an account to join the conversation.

make a form with the choice of the recipient according to the subject 1 year 1 month ago #236539

  • mihaela
  • Offline
  • Developer
  • Developer
  • Posts: 3128
  • Karma: 105
  • Thanks: 413
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

Please Log in or Create an account to join the conversation.

make a form with the choice of the recipient according to the subject 1 year 1 month ago #236566

  • Topic Author
  • jackminv
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 5
  • Thanks: 0
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
Attachments:

Please Log in or Create an account to join the conversation.

make a form with the choice of the recipient according to the subject 1 year 1 month ago #236599

  • mihaela
  • Offline
  • Developer
  • Developer
  • Posts: 3128
  • Karma: 105
  • Thanks: 413
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

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
  • 2
Moderators: ForumSupport
Time to create page: 0.098 seconds

Summer Sale!

Massive discounts on all subscriptions!

Get Your Subscription Here

Quick Links

Downloads

BreezingForms

ContentBuilder

BreezingCommerce

Templates

Documentation

BreezingForms

ContentBuilder

BreezingCommerce

Apprendre BreezingForms (French Community)

Apprendre et maîtriser BreezingForms par des tutoriels et exemples, le tout en français

breezingforms.eddy-vh.com

Questions et réponses sur les forums de l'AFUJ

AFUJ

Special Offer

Summer Sale! All subscriptions at a special price!

Includes prio support, all of our current and future Joomla!® extensions and Joomla!® templates for the duration of your membership.

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!