Hi,
I have an app where I have added a gallery control and inside the gallery I have added few text boxes. I want to apply mandatory field validation on these text boxes (for each row of gallery control). I want to run this validation the click of "Save" button.
Can some one please tell me how can I achieve that?
Note: Screenshot attached of my app.
Thanks
Saksham
Solved! Go to Solution.
Hi @sakshamgupta01 ,
Try to put the following code to App.OnStart property and the OnChange property of TextInput1 and TextInput2 inside the gallery.
Clear(BlankField);ForAll(Gallery2.AllItems, If(IsBlank(TextInput1.Text)|| IsBlank(TextInput2.Text),Collect(BlankField, true)));
Then, set the DisplayMode property of Save button as follows:
If(true in BlankField,DisplayMode.Disabled,DisplayMode.Edit)
Save Button is enabled only when all text boxes 1 and 2 in the gallery are filled in.
Hope this helps.
Sik
Your information on what control you want to validate is not clear but try;
On the displaymode of the button:
If(IsBlank(Textbox1.Text) Or Dropdown1.Selected=IsBlank (), DisplayMode.Didabled,DisplayMode.Edit)
------------
If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.
Hi,
This didn't worked for me, as I want to enable the save button when all rows inside gallery control has a value else save button should be disabled.
Thanks
Saksham
What are the names of your controls and how many are they. The structure of the formula I gave is ok. Jus give the names.
------------
If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.
Hi @sakshamgupta01 ,
Try to put the following code to App.OnStart property and the OnChange property of TextInput1 and TextInput2 inside the gallery.
Clear(BlankField);ForAll(Gallery2.AllItems, If(IsBlank(TextInput1.Text)|| IsBlank(TextInput2.Text),Collect(BlankField, true)));
Then, set the DisplayMode property of Save button as follows:
If(true in BlankField,DisplayMode.Disabled,DisplayMode.Edit)
Save Button is enabled only when all text boxes 1 and 2 in the gallery are filled in.
Hope this helps.
Sik
Thanks, this works perfectly fine ! 😊
User | Count |
---|---|
196 | |
124 | |
88 | |
49 | |
42 |
User | Count |
---|---|
285 | |
162 | |
138 | |
77 | |
73 |