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.
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.