Skip to main content
MaksDad07
Inspiring
February 27, 2018
Answered

Conditionally required fields

  • February 27, 2018
  • 1 reply
  • 811 views

I have two similar questions;

1.  I would like to make fields in my form required based on the value entered in another field.  i.e. field a > 10 then field b is required

2.  Alternately, I would like to make field d required if there is any value in field c

Thank you ahead of time for your help.

This topic has been closed for replies.
Correct answer try67

As the custom validation of field "a" enter:

this.getField("b").required = Number(event.value)>10;

As the custom validation of field "c" enter:

this.getField("c").required = (event.value!="");

1 reply

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
February 27, 2018

As the custom validation of field "a" enter:

this.getField("b").required = Number(event.value)>10;

As the custom validation of field "c" enter:

this.getField("c").required = (event.value!="");