172
Views
6
Comments
mandatory inputs

Hello,

I have a reactive application that has many inputs. Some are in forms, some are in a table outside the form etc. I know outsystems has its inbuilt mandatory validation within forms, but how do i easily enable this mandatory validation for those input widget that are within a table for example? Thank you!

2020-07-21 19-28-50
Rajat Agrawal
Champion

Hi Low,

Within the table you can use customize filter that will help you.

For more help you can share something than we will check on that .


Regards,

Rajat

2022-02-03 15-55-20
Diogo Pereira

Hi,

You can always place a form widget that has all inputs inside, just for validation purpose, removing all CSS classes that you don't need, and the built in validations will work

UserImage.jpg
Lavanya A

hi,
if you are searching a validation for table you can use forge component , you may gets inputs from this post https://www.outsystems.com/forums/discussion/83612/validation-inside-table/,

2024-08-08 07-20-58
Tejas Mahale

Hello @Low Nico , the input widgets have 'valid' and 'validation message' variables. You can use 'If' conditions to your requirements and set (using assign) the 'valid' variable to false and put some message in 'validation message' variable which will be displayed in red below the input widget if it doesn't validate.


Hope this helps.

Tejas Mahale.

2024-07-09 06-45-01
Adarsh

Hi @Low Nico 

To enable mandatory validation for input widgets outside of forms in Outsystems, you can manually trigger the validation logic since the built-in form validation only applies to inputs inside forms.

Here’s a general approach to enable mandatory validation for input widgets outside a form:

  1. Add Validation to Individual Widgets:

    • For each input widget (inside the table or other containers), set the Required property to True in the widget’s properties panel.
  2. Create a Custom Validation Logic:

    • You can create an action that checks the value of each of the input widgets outside the form. In this action:
      • Use the IsNullOrEmpty or IsValid functions to validate each input widget’s value.
      • If any widget fails validation, display an error message or highlight the invalid field using the ValidationMessage widget or other UI changes (like setting CSS styles to mark fields as invalid).
  3. Trigger the Validation Action:

    • Create a button or action that triggers the custom validation logic when the user submits or interacts with the form. If the validation fails, prevent further actions like saving the data or proceeding.
  4. Handle Invalid Inputs:

    • When inputs fail validation, you can use the Valid property of the input widgets to show error states or mark the fields invalid.


Please do let me know if you need anything specific.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.