var form = “423214”; // replace this with your form’s id.
var viewkey = “aWhgE32sa3” // replace this with your form’s viewkey.
// build the url
var url = “http://www.formstack.com/forms/js.php?form=”;
url += form;
url += “&viewkey=”;
url += viewkey;
url += “&style_version=2”;
url += location.search.replace(‘?’,’&’);
// create the script element.
var s = document.createElement(‘script’);
// get the script’s ‘outer html’ and add it to the document.
var t = document.createElement(‘div’);
To use the above script, you will need to modify the ‘form’ and ‘viewkey’ variables so that they are set to the form you wish to embed (if you don’t know how to find your form’s id and viewkey values, please view the link above). Then, simply copy and paste this script into your HTML, just like you would the regular embed code.
After you embed the script, simply append data to the query string to ensure that the fields are pre-populating. For instance, if I have a name field on my form with the label ‘name’, I could pre-populate it by the following url: