I have a form where the submission button should only light up if all the fields in the form are filled in. Here is what I have on the default for the toggle. !IsBlank(DataCardValue1.Text)&& !IsBlank(DataCardValue6.Text) && !IsBlank(Label3.Text) && !IsBlank(DataCardValue9.Text)&& !IsBlank(Label6.Text)&& !IsBlank(DataCardValue7.Text). On the display mode for the submit button I have this If(tglvalidform.Value, Edit, Disabled). It only works if there are only two && once I put the others the button never lights up. I am not sure what I am doing wrong here.
Solved! Go to Solution.
Try re-arranging and putting all the && first and then add the ||. If that won't work you are going to have to write it differently like this:
If(First series of &&, ||, true,
Second series of &&, ||, true,
false,
)
Have you tried putting tglvalidform.Value in a label to make sure it's giving you the true/false value you expect?
As a suggestion...if all of those controls in your Formula are in your form, then set the Required property of your datacards that contain those controls to true
Then set your button DisplayMode property to: If(yourFormName.Valid, Edit, Disabled)
No need for a separate toggle control. The form will do the validation for you.
I hope this is helpful for you.
I think you may have meant .Valid rather than .Value to check if all the fields in the form are valid for submission.
If(yourFormName.Valid, Edit, Disabled)
Thanks for noticing! Sometimes I type ahead of my mind. I corrected.
I am confused about why I would put this on the datacard. When I do that to the datacard it makes the card gray out and I can't select anything. I just want the submit button to be grayed out until all the fields are filled in on the form. @RandyHayes
I tried that and noticed if I take everything else out and leave two is blanks it works. When I add a third and it never changes to false..Is the syntax wrong?? So when I changed it to this !IsBlank(DataCardValue1.Text)&& !IsBlank(DataCardValue6.Text) the button lit up when I filled in datacardvalue6 but if I added another datacard value it never lights up @JR-BejeweledOne
Are you sure when you added the 3rd IsBlank that you included the !? I have written these sorts of formulas and included 7 or 8 or more fields and haven't had this sort of issue.
!IsBlank(DataCardValue1.Text)&& !IsBlank(DataCardValue6.Text) || !IsBlank(Label3.Text) && !IsBlank(DataCardValue9.Text)|| !IsBlank(Label6.Text)&& !IsBlank(DataCardValue7.Text)&& !IsBlank(DataCardValue10.Text)|| !IsBlank(DataCardValue15.Text)&& !IsBlank(DataCardValue8.Text)|| !IsBlank(Label16.Text)&& !IsBlank(DataCardValue11.Text)&& !IsBlank(DataCardValue12.Text)&& !IsBlank(DataCardValue13.Text) - This is the new formula I put on the default for toggle and it works for the initial form submission. The issue with this is if the user were to go into the gallery and then picked that item the button would still be grayed even though everything is filled in. The reason I do the or is because the value on the comboboxes so away so I set the labels ThisItem.X. So when originally submitting the form it uses the actual data card, but if they want to update their form it relies on the label so be filled it which it is. I think there is somthing wrong with my syntax. For the data cards that are comboboxes I need either the label or the datacard to be filled in. @JR-BejeweledOne
Try re-arranging and putting all the && first and then add the ||. If that won't work you are going to have to write it differently like this:
If(First series of &&, ||, true,
Second series of &&, ||, true,
false,
)
User | Count |
---|---|
254 | |
252 | |
82 | |
45 | |
27 |
User | Count |
---|---|
350 | |
267 | |
127 | |
61 | |
58 |