Hi,
I got a checkbox (subscription list) regarding conditions of participation (id of the checkbox field = c9f733b0-fd5b-ec11-8f8f-000d3adf1c7e ) on my marketing form.
What I want to achieve is, if the checkbox is NOT checked the form can not be submitted and the default "required field" error message should pop up.
I found this validation sample for dynamics marketing:
MsCrmMkt.MsCrmFormLoader.on('formSubmit', function(event)
{ // sample validation - check if
document.getElementById('txt-company-name-message').style.visibility = 'hidden';
var companyName = document.getElementById('txt-company-name').value;
if (companyName !== 'Fabricam' && companyName != 'Contoso')
{ document.getElementById('txt-company-name-message').style.visibility = 'visible';
event.preventDefault();
} });
How would I need modify this javascript to reach the behaviour with "If checkbox (c9f733b0-fd5b-ec11-8f8f-000d3adf1c7e) is not checked or =! 1, dont submit the form and throw and error.
Thanks!