I have an Edit form (Form1).
I have a Submit button with 'SubmitForm(Form1)' in OnSelect.
Is there a way to set the Submit button DisplayMode default to 'Disabled' until any text is changed in any field in Form1?
No changes, individual can click out of screen elsewhere.
If a change is made in any field or to any control in Form1 the Submit button changes to 'Edit'?
Solved! Go to Solution.
Hi @Phineas ,
Please try below approach:
1. OnVisible of the Screen set a variable:
UpdateContext({Mode: true})
2. OnChange of all the input controls such as Text inputs and combo box in the form:
If(Not(Self.Text = Parent.Default), UpdateContext({Mode: false}, UpdateContext({Mode: true})
3. DisplayMode of submit button:
If(Mode, DisplayMode.Disabled, DisplayMode.Edit)
However, please note that if user changes some fields then change a part of them back to default, this may not work properly.
Hope this helps.
Best regards,
Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.
@Phineas, use If(Form.Valid && Form.Unsaved, Edit,Disabled) in the Button DisplaMode
Regards,
Ahmed
If my reply helped you, please give a 👍. And if it has solved your issue, please consider Accepting it as the Solution to help other members of the community find it more.
No changes made to the test data and Submit button is in 'Edit'.
This is not the desired outcome.
Goal: On new screen/screen open the Submit button should be 'Disabled'.
Once any changes are made to the default data in the edit form the Submit button should change to 'Edit'.
@Phineas , in your app settings, make sure to enable Formula-Level error Managment:
Also, is your form in an edit mode?
Toggle is on.
Form1 is in 'Edit'.
If I add and exclamation the button is 'Disabled'. However, changes to the form content do not change the button to 'Edit' as desired.
If(!Form1.Valid && Form1.Unsaved, Edit,Disabled)
@Phineas , I think your issue is one or more of your form's fields has a default value that is using a lookup. When we use a LookUp to retrieve the default value of the field, the lookup will run when the form is visible and that will be considered as a change.
Hi @Phineas ,
Please try below approach:
1. OnVisible of the Screen set a variable:
UpdateContext({Mode: true})
2. OnChange of all the input controls such as Text inputs and combo box in the form:
If(Not(Self.Text = Parent.Default), UpdateContext({Mode: false}, UpdateContext({Mode: true})
3. DisplayMode of submit button:
If(Mode, DisplayMode.Disabled, DisplayMode.Edit)
However, please note that if user changes some fields then change a part of them back to default, this may not work properly.
Hope this helps.
Best regards,
Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.
User | Count |
---|---|
121 | |
88 | |
88 | |
75 | |
66 |
User | Count |
---|---|
216 | |
180 | |
138 | |
96 | |
73 |