Expand my Community achievements bar.

Dynamic URL Parameters on Submit Button

Avatar

Level 4

When a user clicks this Livecycle form, the Submit to URL is set to http://www.ourserver.com/formmailer.php?CC=strCCAddress, where this parameter is set on the button in the Script Editor, like this.

    var strToAddress, strCCAddress, strSubject, strMessage, strSuffix, strMgrFirstName, strMgrLastName, strStoreNum, strRegionNum
   
strToAddress = txtToAddress.rawValue;
strCCAddress = txtCCAddress.rawValue;
strSuffix = form1.Page1.DropDownList1.rawValue;
strMgrFirstName = form1.page3.MgrFirstName.rawValue;
strMgrLastName = form1.page3.MgrLastName.rawValue;
strStoreNum = form1.Page1.storeNumber.rawValue;
strRegionNum = form1.page3.distRegion.rawValue;

    this.resolveNode("#event").submit.target = "mailto:"+ strToAddress + "?cc=" + strCCAddress + "&subject=" + "LOA request for "  + strSuffix + " DSM " + strMgrFirstName + " " + strMgrLastName + " Store# " + strStoreNum + " Region# " + strRegionNum;
    }

This takes me to the target page where I see

Email To Address: strCCAddress

instead of

Email To Address: someEmail Address@someplace.com (the CC address that the user entered into the form).

How can I set from values for URL params at runtime?

The plan is to set these URL params, which PHP can then grab, using $_GET[] and send the PDF form on to various recipients.

1 Reply

Avatar

Level 4

On the Submit button in Object Properties>Submit to URL, I have the HTTP protocol

http://www.ourserver.com/formmailer.php

and in the javascript on the button event I have

this.resolveNode("#event").submit.target = "mailto:"+ strToAddress + "?cc=" + strCCAddress + "&subject=" + "LOA request for "  + strSuffix + " DSM " + strMgrFirstName + " " + strMgrLastName + " Store# " + strStoreNum + " Region# " + strRegionNum;
    }

This should be the HTTP protocol, too (with more URL params added), which probably should look something like this

this.resolveNode("#event").submit.target = "http://www.ourserver.com/formmailer.php:" +  "?cc=" + strCCAddress + "&subject=" + "LOA request for "  +  strSuffix + " DSM " + strMgrFirstName + " " + strMgrLastName + " Store# "  + strStoreNum + " Region# " + strRegionNum;