Hi Community,

Whenever i am making any widget inside Form invalid with on-change action and Checking Form is valid or not on save button click, it gives me valid Form. It must give invalid.

Environment :  OS11, web application reactive

PFA oml

Regards,

Virat

Hi, 

At On change you have set 



So At every change it invalidate your input filed and your filed look like below .


As we know Input.Valid is runtime property. At save action you have not set any  input_Attribute1.Valid =False. 

So If input mandatory property set to True, Its apply built-in validation and It will check , Is Input filed value have correct datatype and empty or not . So here input filed is not empty and also it has correct datatype. That's why always 

Form1.Valid = True

 is coming.  

If your input mandatory property set to False. then it will not check input filed have value or not. and Form1.Valid is True.

Important Note : 

For form validation you need to set Built-in validation property set to yes.

Link & Button method navigate do not submit then there is no validation.  

 

Regards.

rahul

Rahul Kumar wrote:

Hi, 

At On change you have set 



So At every change it invalidate your input filed and your filed look like below .


As we know Input.Valid is runtime property. At save action you have not set any  input_Attribute1.Valid =False. 

So If input mandatory property set to True, Its apply built-in validation and It will check , Is Input filed value have correct datatype and empty or not . So here input filed is not empty and also it has correct datatype. That's why always 

Form1.Valid = True

 is coming.  

If your input mandatory property set to False. then it will not check input filed have value or not. and Form1.Valid is True.

Important Note : 

For form validation you need to set Built-in validation property set to yes.

Link & Button method navigate do not submit then there is no validation.  

 

Regards.

rahul

So you mean to say if we make any widget invalid on onchange event then we have to check it explicitly on save button?


Solution

virat kohli wrote:

Rahul Kumar wrote:

Hi, 

At On change you have set 



So At every change it invalidate your input filed and your filed look like below .


As we know Input.Valid is runtime property. At save action you have not set any  input_Attribute1.Valid =False. 

So If input mandatory property set to True, Its apply built-in validation and It will check , Is Input filed value have correct datatype and empty or not . So here input filed is not empty and also it has correct datatype. That's why always 

Form1.Valid = True

 is coming.  

If your input mandatory property set to False. then it will not check input filed have value or not. and Form1.Valid is True.

Important Note : 

For form validation you need to set Built-in validation property set to yes.

Link & Button method navigate do not submit then there is no validation.  

 

Regards.

rahul

So you mean to say if we make any widget invalid on onchange event then we have to check it explicitly on save button?



As i said Input.Valid is runtime property if you do not define Input.Valid  on save so it implements its own build-in validation for this pipeline.


Solution

Hello Virat.

Have you done the training?

That .Valid is where you save if your validation tests completed successfully. If you say it is not, it will fail.

https://www.outsystems.com/learn/courses/130/form-validations/