Exclude a variable from submit

Hello,

I have some optional input fields in my embedded form which the user will probably leave them empty.

I’m trying to exclude these variables from being submitted if they are left empty:

camForm.on('submit', function() {
  camForm.variableManager.destroyVariable('itemName1');
});

But when I hit submit on my form, nothing happens and there are no logs on my browser console.

Any idea what’s going wrong?

Hi @ams,

What do you mean by nothing happens?
Can you please share your html form…

What I meant was that I can’t submit the form.

Anyways the issue was fixed, I had a syntax error in my code.

Thank you!

1 Like