40
Views
4
Comments
How to customize validation messages for different input types in a dynamic form?

I’m working on a dynamic form that contains a list of inputs generated from a dataset. Some of these inputs are mandatory and have validations to ensure they are filled out. When a required field is not filled, its appearance changes (e.g., red border and a predefined message).

However, the form contains various input types: text, numbers, and dates. I need the validation messages to be customized according to the input type. For instance, a text field should show a specific message like "This field is required," a numeric field should display "Please enter a valid number," and a date field should show "Please select a valid date."



Pregunta Pantalla.png
Pregunta Bloque.png
2019-01-07 16-04-16
Siya
 
MVP

Since the 'Register' button is inside the form, submitting it triggers the built-in validation for all elements within the form, even if they are part of a block. If any mandatory fields are left empty or contain incorrect input, the default validation messages will be displayed. 

In your Question block you have 3 input widgets and they are of different types. Depending on the datatype and Visibility, the validation message will be shown.

UserImage.jpg
Chin Kai

On the "Submit" button you can create if else and add individual assignments to the valid name list and error message you want to display. 

Something like this: 

2025-07-28 06-45-20
Rupesh Patil

Hello @Emilio David Paredes Baldeon 

On the "Register" button you can create if else condition I have attached below oml file please check PersonDetail screen in SaveOnClick action I have write logic

I hope this helps

Thanks


OSMDb.oml
2024-08-08 07-20-58
Tejas Mahale

Hi, you can do the required in a set variable widget inside the client action for submit button. 

Just click on widgets once you are setting a variable, select validation message, and enter your desired text like "Enter valid number" etc. You will find the variable 'Validation Message' for every input.

I hope this helps


Thanks,

Tejas

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