BullGuard Antivirus Sale - 60% Off with openElement !
Forum openElement Homepage
Forum Home Forum Home >

openElement

> Error Reports
  New Posts New Posts RSS Feed - Email Form and drop down list
  FAQ FAQ  Forum Search   Register Register  Login Login

Email Form and drop down list

 Post Reply Post Reply
Author
Message
MJS613 View Drop Down
Newbie
Newbie


Joined: 27 Mar 2020
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote MJS613 Quote  Post ReplyReply Direct Link To This Post Topic: Email Form and drop down list
    Posted: 28 Mar 2020 at 18:12
Hi All,

I am new to openElement but am really liking it so far.  I am having a problem with the email form and contact us page.  I am hoping someone here can shed some light on what I am missing.

Scinario:

Contact us page has a drop down list.   1. Support Request & 2. Website issue.  So the user can select one or the other depending on what they are reporting.

I have created 2 email forms one for support and one for website issues.  They have 2 different emails one goes to support the other goes to webmaster. Each form has it's own successful send message. 

So what i want it to do is when you select the support option it uses the support email form and send to support, and if you select website issue it uses the webmaster email form and sends an email to the webmaster.

Here is my issue, it doesn't matter what option you pick it always uses the success message from the webmaster email form and then sends an email to both address.  Now the info in the email is from whatever option they chose.

So i am looking to find out how to separate them and only send to whatever email is selected.

I am on openELement 1.57 R9

Thanks in advanced
Back to Top
Hobby001 View Drop Down
Admin Group
Admin Group
Avatar

Joined: 05 Juin 2018
Location: Canada, Québec
Status: Offline
Points: 5182
Post Options Post Options   Thanks (0) Thanks(0)   Quote Hobby001 Quote  Post ReplyReply Direct Link To This Post Posted: 28 Mar 2020 at 22:26
Hi,

You can't do it directly without writing your own send mail script but there is a way around.

Make sure that you have two buttons on your form. 

Add b1 as custom class to button one.
Add b2 as custom class to button two.
 
Make sure that you have two Email form element on your page.  Assign all required fields plus their respective button to these elements.


Drop down list.

Use 1 as item value to the first selection
Use 2 as item value to the second selection
Add SendTo to Custom classes

Create a new Source code block, Type: javascript, Position: Endbody

Add the following code to it

$(function(){
$('.SendTo select').change(function() { 
var choice = $(this).val();
$('.b1, .b2').hide();
$('.b'+choice).show().css('visibility', 'visible');
}).change(); 
});


Uppon selection of a value, only the proper button will be visible




Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 10.11
Copyright ©2001-2012 Web Wiz Ltd.

This page was generated in 0,031 seconds.