These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Submit via email dynamic based on tick box selection

teros
Registered: Feb 3 2008
Posts: 21

Hi All,

I've seen this before thinking i'll have to use the submitForm() function but here's the scenario.

I have a form for a real estate client they want the following if user select's a state and a specialty say commercial or residential it would go to the manager of that department.

Thinking it may go something like this

submitForm() if (p1.State==SA && p2.Specialty==Commercial)
{
email = barker [at] gmail [dot] com
}
else if (p1.state==WA && p2.specialty==Residential)
{
email = thughes [at] gmail [dot] com
}

Would this be sort of it sorry i know it's pretty simple but have not played in a while and can't really make head or tale of the documentation.

almitche
Expert
Registered: Apr 1 2008
Posts: 41
Hi teros,

This is a little tricky. Here's how I think it would go ... note that I'm using JavaScript within Designer, and not any of the Acrobat JavaScript.

Assume a simple form hierarchy like this:

State
DropDownList1
Button1

In this case, State is the Custom object in Designer that lists out all the US states, DropDownList1 is a list of Commercial or Residential, and Button1 is the button that will submit the email.

Then your script would be something like:

if (State.rawValue == "SA" && DropDownList1.rawValue == "Commercial")
{
Button1.event__click.resolveNode("#submit").target="mailto:barker [at] gmail [dot] com";
}
else if (State.rawValue == "WA" && DropDownList1.rawValue == "Residential")
{
Button1.event__click.resolveNode("#submit").target=""mailto:thughes [at] gmail [dot] com";
}

Where to put the script is tricky, because you want it to be accurate each time the values of the two drop-down lists change. You could try the calculate event of the submit button, or alternatively have the script appear twice, in each of the change events of your two drop-down lists.

Let me know if that works for you, and if it doesn't I'll try something else.

All the best.
humayoo
Registered: May 18 2009
Posts: 12
Hello,

i have big problem.the event.target.submitForm() and submit button perfectly working on windows.

but event.target.submitForm() and submit button did not work on mac os .it gave th error "cannot process the content of type text/html;charset=utf-8".

below are the my code,please help me that ,how will it work on mac.

app.alert("Vänta, det tar en liten stund för bilden att laddas upp och beskäras. Din PDF kommer att laddas om.",3,0);
event.target.submitForm({cURL:"http://62.119.142.107/alstra/submit_data_forimage.php",cSubmitAs: "XML",cCharset:"UTF-8"});

thanks
Humayoo