Checkbox ID of a form not recognized?

My Checkbox of a form won’t get recognized by the code.

I have a hidden checkbox in my form with the id: sprache_ruecksendung

But in my code on this page it won’t get recognized: “An element with the ID ‘#sprache_ruecksendung’ does not exist on this page. Select another element and view or edit its ID in the Properties & Events panel.”

The form in which that checkbox is located has the following ID: #form1
I tried with “$w(‘#sprache_ruecksendung’)” but that doesn’t recognize it.

My Goal is to find out the language of the site to include an if for the automated emails.

Thank you for taking your time to help me!

as you are using a wix form you need to access the fields id a different way. Something like the below could be adjusted to suit

$w.onReady(() => {
  $w("#form1").getFieldValues()
    .then(values => {
      const isGerman = values.sprache_ruecksendung === true;
    });
});

2 Likes