Here is additional details.
I am trying to change the follow-up page of the form via JS, and set a hidden fields value via JS. the only way i know how to do this is via the embed code. I know if I use the drag and drop method I no longer need to change the follow-up page as it can be done in the form itself. however I do not know how to set a specific field.
Here is my embed code I am using. If anyone could help me maniplulate the form via JS when I drag and drop that would be very helpful.
<script src="//app-sjg.marketo.com/js/forms2/js/forms2.js"></script>
<form id="mktoForm_3234"></form>
<script>MktoForms2.loadForm("//app-sjg.marketo.com", "999-999-999", 3234, function(form){
form.onSuccess(function(values, followUpUrl){
//Take the lead to a different page on successful submit, ignoring the form's configured followUpUrl.
location.href = "my URL goes here";
//return false to prevent the submission handler continuing with its own processing
return false;
});
//Set the value of the form source field
form.setValues({ "Form_Source__c":"test"});
});
</script>