11
Views
3
Comments
Solved
How to validate Web block's Inputs Fields on button click of the Web screen.

Hi all,

I have one scenario in which i have two web blocks and what i wan that if i click on the button of the web page my web-blocks validation should be validate...

for easy understand have upload snap as mention in the below screen.

Can anyone help me on that, How can we achieve such scenario..? 


It would be helpful if anyone can upload OML file for understanding.

Thanks,


Rank: #285
Solution

Hi JK2020,

I have attached a sample OML to achieve your scenario. 

Block 1 has Phone field, which shows error if this field does not contain 10 digits.

Block 2 has Email, field, which shows error if email do not include @test.com in its string.

Please check following link for the demo:

https://shweta-gedam.outsystemscloud.com/ValidateWebBlocks/ParentScreen?_ts=637442697224844094


Hope it helps, Thanks

ValidateWebBlocks.oml

Rank: #40120

Hello Shweta,

Thanks, Yes it is working for me.  I really appreciate your quick response.  

And thanks for OML file and URL for demo.


Thanks other as well  for response.


Champion
Rank: #137

Hi,

There are many ways to answer your question.

A simple way would be to:

1) Have the mobile and email variables at the web screen level

2) Upon clicking on the validate button you can determine if the inputs have or not errors

3) Based on the validation, you can pass parameters (such as IsValid and ErrorMessage) to the web blocks and refresh them so that they display the error message if needed

Cheers

Rank: #285
Solution

Hi JK2020,

I have attached a sample OML to achieve your scenario. 

Block 1 has Phone field, which shows error if this field does not contain 10 digits.

Block 2 has Email, field, which shows error if email do not include @test.com in its string.

Please check following link for the demo:

https://shweta-gedam.outsystemscloud.com/ValidateWebBlocks/ParentScreen?_ts=637442697224844094


Hope it helps, Thanks

ValidateWebBlocks.oml

Rank: #40120

Hello Shweta,

Thanks, Yes it is working for me.  I really appreciate your quick response.  

And thanks for OML file and URL for demo.


Thanks other as well  for response.