Create Form with CMS inputs

Is this possible? Basically the cms would include values like form element(checkbox), description of the element and the value(on/off). And thee form would be created from these attributes.

Here is my public share link: LINK
(how to access public share link)

Hi Tomi!
Yes, if I understand right, you want the form to have different types of inputs but with CMS items.

You can go ahead and add inside a form a CMS collection list and add something like the radios or checkboxes inside that collection.

You will need something like this to make it work for something like select fields.

Let me know if it helps and if you have any question!

I’ll check this out.

Yep Thanks!!! Works great.

Now I just need to clear the form. any idea on this.


I’m using this code that I got from here to not send unchecked checkbox values, but as a total noob I’m doing something wrong. This only clears the whole form:


document.addEventListener("DOMContentLoaded", event => {
  // define form element
  let form = document.getElementById("hc-ilmoittautuminen");
  // define submit button
  let submitButton = document.getElementById("submitButton");

  // on button click
  submitButton.addEventListener("click", event => {
    console.log("button clicked");
    // prevent the form from being sent
    // disable empty inputs 🧠
    // submit cleaned form
    // for development only
    setTimeout(function() {
    }, 1000);

// disableEmptyInputs() declaration
function disableEmptyInputs() {
  // create an array of all targeted inputs
  let inputs = document.getElementsByClassName("checkbox-input");

  // for every input of the array
  for (let i = 0; i < inputs.length; i++) {
    let input = inputs[i];

    // check if the input value is empty or null
    if (input.value === false) {
      // disable empty input
      input.disabled = true;
    } // end of if statement
  } // end of for loop
} // end of disableEmptyInputs() declaration