Make Field on Form Required Based on Previous Field's Answer

  • 17 November 2015
  • 11 replies
  • 10 views

Badge +5

I have a list with two columns.

 

Column A is a required choice column. The choices are Yes, No.

Column B is a single line of text column. It is not required.

 

If a user selects Yes from Column A, then Column B should remain not required.

If a user selects No from Column A, then Column B should become required to have text in the text box.

 

How can I accomplish this?

 

I tried to set a validation rule on my text box control that says (ColumnA =="No"), which works BUT when i then enter text in the box, it still treats it as not being satisfied. I need a rule to say if ColumnA == "No" and if the feild is empty. Is  that possible?


11 replies

Userlevel 6
Badge +16

I think that you must base your rule on a calculated field setting on the formula your 2 conditions.

Userlevel 5
Badge +12

Yes this is possible using validation rules.  Make sure you are using Named Controls in your rule and not Item Properties when referring to ColumnA.

Badge +5

I'm not sure what you mean. Can you provide an example?

Badge +5

Yes - I was using the Named Controls when i tried my first validation rule. Do you have an example of the condition that would accomplish this using a Validation rule?

Userlevel 5
Badge +12

Ok, what version of Nintex are you using?  On-prem or O365.  Version number will be good too in case of a bug.

Thanks

Badge +5

On-Prem, Nintex Forms 2010 v1.6.1.0

Userlevel 5
Badge +12

Here is the rule that you need without the second part you will always get invalid:

 

ColumnA == "No" && isNullOrEmpty({Self})

Userlevel 5
Badge +12

PS: {Self} is a variable found under Named Controls and refers to the control the rule is sitting on. In this case the textbox.

Badge +5

Yes that's it! Of course i tried to use isNullOrEmpty before but I didn't but the "{Self} call in there. Thank you so much!

Userlevel 5
Badge +12

No problem and glad to help  happy.png

Badge +7

I have a similar question.

I have field A which is a currency field. if that is populated I want all the rest of the fields to be required. if it is not populated the rest of the fields do not need to be populated. Help!

Reply