Skip to main content

There was a form that I wanted use the submit button to execute a Smartobject create method, but only if a check box was checked. The submit button worked prior to adding the check box, with the data populated my Smartobject.  I'll show you what my issue is and how I solved it, I hope you can learn from my mistake. 

 

 

 

 

I assumed the value of the check box was yes or no. Based on the icon next to the Data Type.

 

 

14909iF1957FE59743B0C0.png

 

 

 

 

 

I created a rule that would execute the create method, when the button was clicked, if the value of the check box was Yes, like the icon.

 

 

11701i3C428CF28D0FF3AE.png

 

 

 

 

 

The button did nothing, and it did not matter if the box was checked or unchecked. 

 

 

It was suggested to me to check the value of the check box by adding a Data Label to transfer the check box data to.  That way I can see what the check box was evaluating to. 

 

 

 

 

 

I added the Data Label to my view with rules to transfer data from the check box "Checked" to the data label. 

 

 

When the view is initialized or check box changes, then transfer data from the check box to the data label. 

 

 

 

 

 

15336iAA94290B7108B87D.png

 

 

13349iD8A9EF4CD65C015B.png

 

 

16615i4E414DF97EDB17AA.png

 

 

 

 

 

Then I can see what the value actually is!

 

 

16706iCBD883BE7FE51CD3.png

 

 

14265iCF32617E423F82CF.png

 

 

 

 

 

The Data Label showed me that check box evaluates to "true" or "false" not "Yes" or "No"

 

 

 

 

 

I then changed the rule to When the check box contains a specific value "true" Then execute the Smartobject method. 

 

 

12568i189258B3B4580366.png

 

 

 

 

 

The Form worked, and only submitted when the check box was checked, which was the goal.

 

 

If you ever need to know what the value of at item is, transfer the data to Data Label and you can see it.

 

 

 

 

 

I did delete the data label after I got the form working, but it was a really big help to show me what was going on. 

 

 

 

 

Thanks for posting this!


Many thanks I will give this a try


Reply