Require Field if Displayed
I have a Select field and then a follow-up Number that shows only if option 1 is selected in the Select. I'm trying to make the Number field required only if it is displayed. I've tried a few ways of writing the validation, but I can't figure out how to get it to require the Number. What I have right now:
select_field==0 || (select_field==1 && number_field>0)
I can get it to work with a Text field by saying number_field.length>0, but the same doesn't seem to work for Numbers.
Alternately is there a way to dynamically change the required property, rather than looking at the value of the number field?
-
Hi dan
Can you not just put the number field as required? Then set it’s conditional to select_field==1.That would say that the number field is now true so it can’t continue if it’s false.
As penny said if you set a conditional on a required field it only shows when that is true, otherwise it doesn’t show so it’s not active
Please sign in to leave a comment.
Comments
4 comments