Skip to main content
saidivyam
May 6, 2022
Question

Validate required fields

  • May 6, 2022
  • 4 replies
  • 0 views

Hi All,

 Our Requirement is  that we have two tabs in one Tab i have user Info on the another Tab  is about filling Loan details . I have made certain fields required in both tabs.When I switching to another tab it is not validating the required fields of the  previous Tab and storing it in the datastore . I used parent and child interface model to have  these tabs.

Is there any method to achieve this requirement?

Thanks,

saidivya.

4 replies

gopalk2865
Participating Frequently
May 6, 2022

Hi,Are you using button to go from one tab to another ? If yes then you can add your condition(basically combination of multiple validations for null check) on the button. So if any required fields are null then button will be disabled or on click you may consider creating an error using rich text. I hope it helps.

saidivyam
saidivyamAuthor
May 6, 2022

Hi Gopalk,

          I have button only in one tab and to move to next tab directly clicking on the other tab link on the top.

Thanks,

saidivya Minna

mikes0011
Brainy
May 6, 2022

You'll have to do the validation "manually" in this case.  A favorite way of mine is to create a "Validation rule" (expression rule) which takes as inputs basically all the data (CDTs, etc) the user is in charge of populating in any of the tabs, and does a simple/quick check that each required field is filled (and, if needed, valid in other ways). 

You would then use this in a section-level or form-level validation using a!validationMessage() set to validate on "Submit", and if any fields are missing/invalid on any not-currently-visible tab(s), the validation will inform the user that they need to check the other tab(s) for required / invalid fields.  If you toy with it enough, you might even be able to enhance this to where it could tell the user which tab currently has issue(s), though TBH i'd shoot for handling the simpler version of this first.

The Expression Guru
saidivyam
saidivyamAuthor
May 6, 2022

Thanks Mike