Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.

Agree to terms and conditions check box

Avatar

Level 2

I am using a checkbox for users to indicate that they agree to the forms terms and conditions. On Submit how can I validate that the box was checked and if not block the Submit process from completing until the checkbox is selected.

1 Reply

Avatar

Former Community Member

Make the submit button presence 'hidden', add a second button that performs the check box validation and if the validation succeeds, call 'click' on the submit button.

// form1.page1.subform1.callSubmitBtn::click - (JavaScript, client)

if (form1.page1.subform1.cb.rawValue == "0") {

   xfa.host.messageBox("Please agree to terms and conditions.","Agree",0);

}

else {

   form1.page1.subform1.submitBtn.execEvent("click");

}

Steve