I am trying to create a pardot form handler that will notify 1 of 3 different emails, dependent upon the choice the user makes on a specific form field.
I was directed to the Knowledge base article here: http://help.pardot.com/customer/portal/articles/2125987-using-form-field-based-completion-actions
and I tried to implement this code snippet (although it states this should be placed in the "Thank You" code for the pardot form, and I can't find that)
<script type="text/javascript">
var email = encodeURIComponent('%%email{js}%%')
switch('%%your_field_id{js}%%')
{
case 'VALUE_1': document.write('<iframe src="FORM_HANDLER_1_URL?email=' + email + '" height="1px" width="1px" />');
break;
case 'VALUE_2': document.write('<iframe src="FORM_HANDLER_2_URL?email=' + email + '" height="1px" width="1px" />');
break;
}
</script>
Here is roughly what I ended up with, and pasted under my form html:
<script type="text/javascript">
var email = encodeURIComponent('%%email{js}%%')
switch('%%Product{js}%%')
{
case 'Integrated Solutions': document.write('<iframe src="MYSECRETURL?email=' + [email protected] + ' &Product=%%Product%%&first-name=%%first-name%%&last-name=%%last-name%%&company=%%company%%" " height="1px" width="1px" />');
break;
case 'Internet of Things': document.write('<iframe src="MYSECRETURL?email=' + [email protected] + '&Product=%%Product%%&first-name=%%first-name%%&last-name=%%last-name%%&company=%%company%%" '" height="1px" width="1px" />');
break;
case 'Mobile POS Solutions': document.write('<iframe src="MYSECRETURL?email=' + [email protected] + '&Product=%%Product%%&first-name=%%first-name%%&last-name=%%last-name%%&company=%%company%%" '" height="1px" width="1px" />');
break;
}
</script>
Can anyone help me find out what I am doing wrong here? Where is this "Thank you" code?