276
Views
6
Comments
Solved
How to validate input inside a table?
Question
Application Type
Reactive

Hello, I have a product table list with an input per row, and upon Input Onchange I want to do some validation and highlight the input if it is invalid. However I can't find the Input Id (for the Valid and ValidationMessage attributes) on the assign node when I'm trying to do so, not sure why. I only noticed this when the input is inside a table, but I can see the id if it is in a form. Any idea how to do this?

Attached is the oml

ProductSample.oml
2021-06-02 20-50-04
Márcio Carvalho
Solution

You need to pass through input parameter to the validation action.

ProductSample (1).oml
2024-07-05 14-16-55
Daniël Kuhlmann
Ā 
MVP

I marked this reply also as solution, the solution marked by the original poster as solution does mention that MƔrcio's solution is the good solution.

UserImage.jpg
Tejas Mendse
Solution

Hi @ars art -
You can pass the widgetId as mentioned by Marcio in the above comments. In addition to that, using javascript you can validate the textbox (i.e. highlight particular text box) if it exceeds the quantity value. Also, if you add lesser order quantity the bordor will be removed. I am attaching the OML for your reference. 

Also, please go through the test URL -  https://tejas-mendse.outsystemscloud.com/ProductSample/Products?_ts=637962666237052475



ProductSampleWithJS.oml
2021-06-02 20-50-04
Márcio Carvalho
Solution

You need to pass through input parameter to the validation action.

ProductSample (1).oml
2024-07-05 14-16-55
Daniël Kuhlmann
Ā 
MVP

I marked this reply also as solution, the solution marked by the original poster as solution does mention that MƔrcio's solution is the good solution.

UserImage.jpg
Accelance Partners

@ars art

 You can build your custom validation using boolean var and CSS. I have created functionality in your oml. 

please find below

Thanks 

Shriyash

Product_Sample.oml
UserImage.jpg
Tejas Mendse

Hi @Shriyash Dixit -
Your solution will not work correctly. It will highlight bordor red for all the text box in the list even if it is less than the quantity. Please see below image. You can try to reproduce it.

UserImage.jpg
Accelance Partners

Hi @Tejas Mendse
 
As you have mentioned in my solution "It will highlight border red for all the text boxes in the list even if it is less than the quantity. "

I cross-checked it, I only removed text validation functionality it is working, it is not highlighting all the boxes. we can see In your attached screenshot also, you can try once - remove text from UI screen


Thanks

Product_Sample.oml
UserImage.jpg
Tejas Mendse
Solution

Hi @ars art -
You can pass the widgetId as mentioned by Marcio in the above comments. In addition to that, using javascript you can validate the textbox (i.e. highlight particular text box) if it exceeds the quantity value. Also, if you add lesser order quantity the bordor will be removed. I am attaching the OML for your reference. 

Also, please go through the test URL -  https://tejas-mendse.outsystemscloud.com/ProductSample/Products?_ts=637962666237052475



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