Skip to main content
Nintex Community Menu Bar
Solved

How do I disable a required(mandatory) field based on a choice?

  • October 6, 2016
  • 8 replies
  • 711 views
  • Translate

Forum|alt.badge.img+3

Here's my problem, and I am sure others have come across this.

 

I have a drop with 2 choices, A and B

I have a panel containing multiple required fields.

This panel should be hidden and all fields disabled when the drop is set to B.

Using rules allows me to hide the panel and fields but the disable option does not take effect.

 

I have tried custom validation using these steps http://blog.qumsieh.ca/2013/01/14/nintex-forms-basi-validation/comment-page-1/#comment-281416 but havn't worked out how to disable the validation if the panel is hidden.

I've scoured google but don't have a clear step by step.

 

Please can someone assist or provide a link to steps that work?

 

Thanks

Jon

Best answer by xMikeX

Hello,

I am going to offer you a simple solution, avoiding custom validation and using the built in rules functionality of the product.   As you have seen, disabling a control does not disable a validation rule placed on it.   The good news is that you can add functionality to your validation rules to make this work nicely.

Here is how you can modify your Nintex Validation rules to get this to work:

and(isNullOrEmpty({Self}), equals(YourChoiceControl,"A"))

The rule above first checks to see if the control {Self} is null or empty which would be replaced by your current rule, the second part is the magic that says make this validation happen only if YourChoiceControl is equal to A.   In other words, the validation won't be activated if your user selected B.

Hope that helped!

Mike

View original
Did this topic help you find an answer to your question?

Forum|alt.badge.img+12
  • October 7, 2016

Hello,

I am going to offer you a simple solution, avoiding custom validation and using the built in rules functionality of the product.   As you have seen, disabling a control does not disable a validation rule placed on it.   The good news is that you can add functionality to your validation rules to make this work nicely.

Here is how you can modify your Nintex Validation rules to get this to work:

and(isNullOrEmpty({Self}), equals(YourChoiceControl,"A"))

The rule above first checks to see if the control {Self} is null or empty which would be replaced by your current rule, the second part is the magic that says make this validation happen only if YourChoiceControl is equal to A.   In other words, the validation won't be activated if your user selected B.

Hope that helped!

Mike

Translate

Forum|alt.badge.img+3
  • October 7, 2016

Thanks Mike, that worked a treat!

I tried something similar but think my formula must have been wrong.

Translate

Forum|alt.badge.img+3
  • October 11, 2016

Hi Mike,

I may have jumped the gun on this.

I have a form in which the rules will disable the field sucessfully, however, on submit the fields error out as they are required.

In the above snippet the highlighted fields are required fields and are disabled when the guest button is selected. unfortunately, they error on submit.

The form has 2 panels, one for "Guest" and another for "Member or Staff"

I've tried other variations on formulas e.g. equals(Tabs, "Guest")

My end goal is to have a rule that will disable(and allow submitting) and hide the panel not selected.

Any ideas?

Cheers

Jon

Translate

Forum|alt.badge.img+12
  • October 12, 2016

Hi John,

Remove the "required" aspect from the fields in the backing SharePoint list, and let the Nintex Forms validation rules do the trick on the front end making them required only when necessary (as described by the rule) .  This will get you the flexibility that you need.   Otherwise, if you are forcing the fields to be required at the Sharepoint list level, then there is nothing Nintex can do on the front end to prevent you from having to enter data.  Nintex will simply respect the "required" settings of the SharePoint list.

Hopefully that answered your question or gives you further direction on how to achieve this.

Thanks,

Mike

Translate

Forum|alt.badge.img+3
  • October 12, 2016

Thanks Mike, that makes sense. I hadn't thought of it in terms of SharePoint vs Nintex.

Translate

  • September 27, 2017

Hi, Mike!

I have almost the same problem the only difference is that I use checkbox with rules that allows me to hide the panel and fields but the disable option of the validation does not take effect. Will this formula be also applicable to my case? Thanks!

Translate

Forum|alt.badge.img+12
  • September 27, 2017

Hello TC N,

The rule may have to be modified slightly in your case - when using a checkbox in a rule, simply the name of the checkbox itself inserted by double clicking on it in the rules pane -   in other words a reference to a checkbox will return true if checked and false if not.  If you let me know what you want to happen when the checkbox is checked or unchecked I can probably elaborate more clearly.

Thanks

Mike

Translate

Underdog

Hi Mike,

If you're still available, how do you change the "Mandatory" field in SPO?

Thanks!

Translate

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings