Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Form changes drop down when emailed

Avatar

Former Community Member
I have created a wonderful form but there appears to have a problem that I can't seem to fix. There is a drop down list with every employees name and the value is specified to their supervisor. Some supervisors have numerous employees. There is a button they click to send the form to their supervisor and it opens Lous Notes and attaches the completed form to an email ready for submission.



The problem is when you open the attachment, it shows a different employee than the one selected when they completed the form. It's like it picked the name of the person in that department with the first name in alphabetical order.



Is there a simple way to fix?



Here's an example of scripts I have used:



This one is in the dropdown list as an "EXIT" event

if (this.rawValue == "daveo@bige.com"){Department.rawValue = "Refrigeration"; }

else if (this.rawValue == "tom@bige.com"){Department.rawValue = "Procurement"; }

else if (this.rawValue == "larry@bige.com"){Department.rawValue = "Help Desk"; }



This one is in the dropdown list as an "VALIDATE" event

// Validate the e-mail address.

var address = new RegExp();

address.compile("^[a-z0-9_\\-\\.]+\\@[a-z0-9_\\-\\.]+\\.[a-z]{2,3}$","i");



var result = address.test(this.rawValue);



if (result == true){

true;

} else {

false;

}



This one is in the dropdown list as an "CHANGE" event

var sNewValue = $.boundItem(xfa.event.newText)

TextField1.rawValue = sNewValue; // Fill the Text box with what you got



This one is in the button as an "PRESUBMIT" event

// Set the URL of the button at runtime.

this.resolveNode("#event").submit.target = "mailto:" + DropDownList3.rawValue + "?subject=PTO Request Form&body=This is a request for Time OFF.";



PLEASE HELP
2 Replies

Avatar

Former Community Member
Still looking for some help here......I've been searching everywhere for this and no luck

Avatar

Former Community Member
Hello Lloyd



Did you have any luck in finding a solution?



I have a requirement where in I select a district from the dropdown list and click on submit to email the form to that particular district's email address.



I added a dropdown list and for the exit event, I have:



if(DropDown.rawValue == "District 1")

{

email.value = "bob@somewhere.com"

}



(In the dropdown list properties, I have set rawtext and their values. eg: District 1 - email@address.com etc).



for the click event of submit button, I have



event.target.submitForm({cURL:'mailto:'+DropDownList1.value+'?subject='+subject.value+'&body='+body.value,cSubmitAs:"PDF",cCharset:"utf-8"});



I have created 2 variables body and subject and added some text values.

But I do not added what value to add to the email variable. I have tried adding my own email address and just the text "email". I am just getting the following error message.."Windows messaging does not recognize object XFAObject" and the name of this popup window is "Check Names"



I am using livecycle designer.