Jump to content
  • 0

Make at least one checkbox required



1 answer to this question

Recommended Posts

  • 0

Hi @Vitalikssssss,

You may use the following code to prevent submittion if non of the checkboxes were not checked:


document.addEventListener("BeforeFormSubmit", myFunction);

function myFunction() {
    let FirstField = document.getElementById("InsertRecordnnn").checked;
    let SecondField = document.getElementById("InsertRecordname").checked;
    let ThirdField = document.getElementById("InsertRecordTF").checked;
    let FourthField = document.getElementById("InsertRecordnumber").checked;

    if (!FirstField && !SecondField && !ThirdField && !FourthField) {

        //for hiding the button container:


The code should be added into the datapages' footer. Also you should rename the fields in the code to the ones you have on your form. Please see the screenshot for better understanding:

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...