Checkboxes type to NULL | Adobe Higher Education
Skip to main content
Level 1
January 24, 2024
Respondido

Checkboxes type to NULL

  • January 24, 2024
  • 7 respostas
  • 3353 Visualizações

 Can the checkboxes field type can be made to NULL if none of the options is selected for a filed For example: I have four checkboxes for a field in my form and initially one was checked later all were unchecked can the field be made NULL?

Este tópico foi fechado para respostas.
Melhor resposta por SanfordWhiteman

Add a checkbox with the literal string value NULL.

 

Hide it by default:

.mktoForm .mktoCheckboxList input[value="NULL"], .mktoForm .mktoCheckboxList input[value="NULL"] + label { display: none; }

 

If the value is empty on submit, then flip it to NULL.

MktoForms2.whenReady(function(readyForm){ readyForm.onSubmit(function(submittingForm){ const currentValues = submittingForm.getValues(); if(currentValues.MyInterestingField == "") { submittingForm.setValeus({ MyInterestingField : "NULL" }); }); }); });

7 Respostas

Jo_Pitts1
Community Advisor
Community Advisor
January 24, 2024

@hemanthappachu

I'm confused by this part of your post:


@hemanthappachu wrote:

I have four checkboxes for a field in my form


One checkbox relates to one field.  Can you clarify your question please.  Maybe some screenshots?

SanfordWhiteman
Level 10
January 24, 2024

Presumably meaning the Checkboxes type?

SanfordWhiteman
Level 10
January 24, 2024

Add a checkbox with the literal string value NULL.

 

Hide it by default:

.mktoForm .mktoCheckboxList input[value="NULL"], .mktoForm .mktoCheckboxList input[value="NULL"] + label { display: none; }

 

If the value is empty on submit, then flip it to NULL.

MktoForms2.whenReady(function(readyForm){ readyForm.onSubmit(function(submittingForm){ const currentValues = submittingForm.getValues(); if(currentValues.MyInterestingField == "") { submittingForm.setValeus({ MyInterestingField : "NULL" }); }); }); });
User Group Leader
January 25, 2024

Love this. Another way: if you would rather use OOTB capabilities, you could use a Change Data Value flowstep that triggers on form fill, create a choice that says IF none of the fields contain any of the checkbox values then make the field NULL. 

 

 

 

SanfordWhiteman
Level 10
January 25, 2024

Well, no.

 

The goal is to empty the field if the person didn’t check off any of the visible fields, because otherwise the field will be left with its old value.

 

Your flow choice is saying “if it’s already empty, empty it.” It won’t have any any effect.