Continuing our previous post on setting hidden field’s value using JavaScript in Embedded Marketing Form,
below are a few more points that could help –
- To hide the Marketing form on the host page – we can use afterFormRender
- To submit the Marketing form on the host page –
- If we are setting a non-existing value for an option set field in the formSubmit event, it will be treated as blank before submission and the blank value will be passed. However if the field is Required then validation will kick in and the form will not get submitted.
Get more details – Extend marketing form using code
var xhttp = new XMLHttpRequest();
xhttp.open("POST", formUrl + "/formpage/” + formId + “/correlation/” + correlationId, true);
xhttp.setRequestHeader("Content-Type", " application/x-www-form-urlencoded");
xhttp.send("7d58e055-d1c2-4bb3-a42f-faf6762e0acc=FirstName&3cdeebb-7c54-4cff-a1bc-772562d25c38=firstname.lastname%40sample.com&submit=");
Hope it helps..
One thought on “How to – Hide, Submit and perform validation in Dynamics 365 Marketing Form”