I want to Disable my Submit button if all required fields have no input. Can you help me ? Heres my code on Displaymode button
If(
Leavetype.Selected.Value = "Paternity leave",
If(
Value(TextInput2_9.Text) > Value(TextInput1_12.Text),
DisplayMode.Disabled,
('SLDCC Leave Form'.Valid),
Edit,
DisplayMode.Disabled
)
) & If(
Leavetype.Selected.Value = "Bereavement Leave",
If(
Value(TextInput2_9.Text) > Value(TextInput1_24.Text),
DisplayMode.Disabled,
('SLDCC Leave Form'.Valid),
Edit,
DisplayMode.Disabled
)
) & If(
Leavetype.Selected.Value = "Maternity leave",
If(
Value(TextInput2_9.Text) > Value(TextInput1_21.Text),
DisplayMode.Disabled,
('SLDCC Leave Form'.Valid),
Edit,
DisplayMode.Disabled
)
) & If(
Leavetype.Selected.Value = "Leave for Victim of Violence (Women&Children)",
If(
Value(TextInput2_9.Text) > Value(TextInput1_27.Text),
DisplayMode.Disabled,
('SLDCC Leave Form'.Valid),
Edit,
DisplayMode.Disabled
)
) & If(
Leavetype.Selected.Value = "Parental Leave for Solo Parents",
If(
Value(TextInput2_9.Text) > Value(TextInput1_18.Text),
DisplayMode.Disabled,
('SLDCC Leave Form'.Valid),
Edit,
DisplayMode.Disabled
)
) & If(
Leavetype.Selected.Value = "Sick Leave",
If(
Value(TextInput2_9.Text) > Value(TextInput1_9.Text),
DisplayMode.Disabled,
('SLDCC Leave Form'.Valid),
Edit,
DisplayMode.Disabled
)
) & If(
Leavetype.Selected.Value = "Vacation Leave",
If(
Value(TextInput2_9.Text) > Value(TextInput1_9.Text),
DisplayMode.Disabled,
('SLDCC Leave Form'.Valid),
Edit,
DisplayMode.Disabled
)
)
Solved! Go to Solution.
Hi @pword ,
Note the below is free-typed, so watch commas, brackets etc, but you should get the idea.
With(
{
wLeave:Leavetype.Selected.Value,
wLeaveAmt:Value(TextInput2_9.Text)
},
If(
!'SLDCC Leave Form'.Valid ||
(
wLeave = "Paternity leave" &&
wLeaveAmt > Value(TextInput1_12.Text)
) ||
(
wLeave = "Bereavement Leave" &&
wLeaveAmt > Value(TextInput1_24.Text)
) ||
(
wLeave = "Maternity leave" &&
wLeaveAmt > Value(TextInput1_21.Text)
) ||
(
wLeave = "Leave for Victim of Violence (Women&Children)" &&
wLeaveAmt > Value(TextInput1_27.Text)
) ||
(
wLeave = "Parental Leave for Solo Parents" &&
wLeaveAmt > Value(TextInput1_18.Text)
) ||
(
wLeave = "Sick Leave" || wLeave = "Vacation Leave" &&
wLeaveAmt > Value(TextInput1_9.Text)
),
DisplayMode.Disabled,
DisplayMode.Edit
)
)
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Hi @pword ,
You have an and/or mix that needs bracketing - when you state
wLeave = "Maternity leave" &&
wMLQualified = "Not Qualified" ||
wLeaveAmt > Value(TextInput1_21.Text
do you mean
wLeave = "Maternity leave" &&
(wMLQualified = "Not Qualified" || wLeaveAmt > Value(TextInput1_21.Text)
or
(wLeave = "Maternity leave" && wMLQualified = "Not Qualified") ||
wLeaveAmt > Value(TextInput1_21.Text
Hi @pword ,
Note the below is free-typed, so watch commas, brackets etc, but you should get the idea.
With(
{
wLeave:Leavetype.Selected.Value,
wLeaveAmt:Value(TextInput2_9.Text)
},
If(
!'SLDCC Leave Form'.Valid ||
(
wLeave = "Paternity leave" &&
wLeaveAmt > Value(TextInput1_12.Text)
) ||
(
wLeave = "Bereavement Leave" &&
wLeaveAmt > Value(TextInput1_24.Text)
) ||
(
wLeave = "Maternity leave" &&
wLeaveAmt > Value(TextInput1_21.Text)
) ||
(
wLeave = "Leave for Victim of Violence (Women&Children)" &&
wLeaveAmt > Value(TextInput1_27.Text)
) ||
(
wLeave = "Parental Leave for Solo Parents" &&
wLeaveAmt > Value(TextInput1_18.Text)
) ||
(
wLeave = "Sick Leave" || wLeave = "Vacation Leave" &&
wLeaveAmt > Value(TextInput1_9.Text)
),
DisplayMode.Disabled,
DisplayMode.Edit
)
)
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Hi @WarrenBelz How to disbable my submit button if my checkbox was uncheck. I use your code but my submit button was enable while my check box was uncheck. Thank you
Attached my screenshot
@pword ,
You just need add the checkbox condition
If(
!'SLDCC Leave Form'.Valid ||
!YourCheckboxName.Value ||
( . . . .
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
@pword ,
Then there is something else wrong with your filter as !Checkbox1_1.Value means it is testing for it to be unchecked (if it is checked, this test will fail). Did the rest of the code work without this in?
Yes @WarrenBelz , the rest of the code is working. But i want my checkbox to be required, even if checked or unchecked my checkbox, my sumbit button was disbable when i put the checkbox condition.
@pword ,
There is a bug there somewhere, however try this (the long way)
With(
{
wLeave:Leavetype.Selected.Value,
wLeaveAmt:Value(TextInput2_9.Text),
wNoCheck:CheckBox1_1.Value <> true
},
If(
!'SLDCC Leave Form'.Valid || wNoCheck ||
(
wLeave = "Paternity leave" &&
wLeaveAmt > Value(TextInput1_12.Text)
) ||
(
wLeave = "Bereavement Leave" &&
wLeaveAmt > Value(TextInput1_24.Text)
) ||
(
wLeave = "Maternity leave" &&
wLeaveAmt > Value(TextInput1_21.Text)
) ||
(
wLeave = "Leave for Victim of Violence (Women&Children)" &&
wLeaveAmt > Value(TextInput1_27.Text)
) ||
(
wLeave = "Parental Leave for Solo Parents" &&
wLeaveAmt > Value(TextInput1_18.Text)
) ||
(
wLeave = "Sick Leave" || wLeave = "Vacation Leave" &&
wLeaveAmt > Value(TextInput1_9.Text)
),
DisplayMode.Disabled,
DisplayMode.Edit
)
)
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
@pword ,
Put a label on the screen with Checkbox1_1.Value and check/uncheck it to see what is shown. Also why do you have those values on the OnCheck and OnUncheck - they do not make a lot of sense to me presently. Also what type of field is it writing to?
User | Count |
---|---|
159 | |
84 | |
70 | |
64 | |
60 |
User | Count |
---|---|
205 | |
147 | |
94 | |
84 | |
67 |