Quantcast
Channel: Adobe Community : All Content - LiveCycle Designer
Viewing all articles
Browse latest Browse all 5571

Drop down reverts back to Value1 on click event of a submit button

$
0
0

Hi,

 

I tried to send eamil according to the drop down list. Something like this:

* Make a drop down list  and list number 1 = Option1 (value1); List no2 = Option2 (value2) and list no3 = Option3 (value3).

 

Now I created a button and when I select option 1 then I want to send email to the option1, when selecting 2- it sends email to second listed email and when selected option3 - it sends email to the third email listed in the button code.

 

PROBLEM :

The code works fine for the first option and opens the PDF attached in outlook but when I select the "option2", and as soon as I clcik the button , the drop down REVERTS back to "option1"   and as a result it sends the mail to "option1" instead of "option2".

 

Here goes the code:

form1.#subform[0].Button1::click - (JavaScript, client)

 

 

if (DropDownList1.rawValue = 1);

{

         var Mailto = "option1@abc.com";

         var Mail = "mailto:" + Mailto;

 

     event.target.submitForm({

    cURL: Mail,

 

    cSubmitAs: "PDF"

    });

}

 

 

elseif (DropDownList1.rawValue = 2);

{

         var Mailto2 = "option2@abc.com";

         var Mail2 = "mailto:" + Mailto2;

 

     event.target.submitForm({

    cURL: Mail2,

    cSubmitAs: "PDF"

    });

}


Viewing all articles
Browse latest Browse all 5571

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>