cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Show or hide controls with Rules in Nintex Forms

Jump to solution

This tutorial is applicable to Nintex Forms 2016, Nintex Forms 2013 and Nintex Forms 2010.

This tutorial assumes that the user has basic knowledge of designing forms with Nintex Forms. If not, please refer to Getting Started with Nintex Forms.

Using Rules to hide a section of the form based on a checkbox

In this scenario, we have using a workshop registration form. We want to know if the person has any special dietary requirements, so we can cater for them. Once we have created the rule, the Dietary requirements panel, as shown below, will only display to the user when the Special diet required checkbox is selected. 

Note: To hide a section on the form, use the Panel control to group controls together. For more information refer to the Panel Control.

rules.png

Name the Yes/No Control

This tutorial begins in the Nintex Forms designer, with a form I’ve already designed. The first step is to name the Special Diet Required, Yes/No control so we have a name we can use when creating the rule. This control will determine whether the Dietary Requirements panel will show on the form during runtime.

Double-click on the Yes/No control to open the settings dialog.

special.png

In the Name field, enter “Special diet required” and click Save.

diet.png

The control has now become a named control.

Use Rules to hide/show the Special Dietary Requirements panel control

The next step is to create the rule. This panel will remain hidden unless the user selects the Special diet required checkbox. To open the Rules pane, click on Rules in the Ribbon.

rules.png

Select the Panel control and then click on Add New Rule. We can now configure the rule. In the Name field, call the rule “Show if special diet’.

In the Condition field, click on the formula builder, f(x), button.

rules2.png

Click on the Runtime Functions tab and double-click on the function not. Click on the Named Controls tab and double-click on Special diet required. The formula should look like this: = not(Special diet required ). Click OK.

Note: Conditions must be expressed as a formula that will result in a TRUE value for the rule to be applied.

condition.png

Finally, check the Hide box on the Rules panel.

hide.png

Now when the Yes/No control is unchecked, this formula will evaluate to TRUE and the panel will be hidden. There is no need to save the rule, it is ready to use straight away.

The form is now ready to be published.

Labels: (1)
Reply
67 Replies
shyamshinde08
Nintex Newbie

Re: Show or hide controls with Rules in Nintex Forms

Jump to solution

Hi,

I have a managed metadata control in my nintex form. Depending on the value selected in the control I need to hide or make visible few panels below.

Can anyone please help in achieving the functionality?

Thanks in Advance

Regards,

Shyam

0 Kudos
Reply
Nintex Employee
Nintex Employee

Re: Show or hide controls with Rules in Nintex Forms

Jump to solution

Hi Shyam,

Nintex Forms currently does not support building formatting rules around the output of a Managed Metadata control.

We recommend adding this request as a feature on our Customer Forum, nintex.uservoice.com.

Thank you,

Sean Fiene

Reply
jordan_deroubai
Nintex Newbie

Re: Show or hide controls with Rules in Nintex Forms

Jump to solution

Hi Nintex team,

I have done the same rule, but I want to checked / unckecked the checkbox with javascript, and unfortunately it's not working.

If I clicked on the checkbox it's working, but not if I checked the checkbox with javascript.

Do you know how can I do that ?

Regards,

Jordan

0 Kudos
Reply
Not applicable

Re: Show or hide controls with Rules in Nintex Forms

Jump to solution

What would the formula look like if the condition on which you want to disable or hide the control panel is Yes?  In other words, if someone checks the box, how is the formula written?  I've tried several things and nothing's working. And, I can't seem to find anything on Nintex about how to craft these conditional formulas.

Reply
Not applicable

Re: Show or hide controls with Rules in Nintex Forms

Jump to solution

Okay, I think I got it.  No = "0" and Yes="1". 

0 Kudos
Reply
Not applicable

Re: Show or hide controls with Rules in Nintex Forms

Jump to solution

Excellent!

Worked as described, but I did run into one anomaly.

The form has two entry fields in sequence, each with a title. Title and field sets arranged vertical by default.

Initial attempt to use a single rule for all four controls resulted in the lower controls moving up and over the upper controls when hidden (the default). When checkbox set to true, fields made visible but the upper controls were beneath the lower controls. Created two identical rules, one each for the title/field controls and excuted sequentially. This time the lower controls did not migrate upward and both sets appeared/disappeared as desired.

Reply
kmcollins
Nintex Newbie

Re: Show or hide controls with Rules in Nintex Forms

Jump to solution

Hi,

Thanks for the post, I've looked at it several times. I was wondering though about using logic in the rules. For example, if you have a drop down list and want a field to show if it is X or Y in the list. How can I find out about doing this?

0 Kudos
Reply
josh
Nintex Newbie

Re: Show or hide controls with Rules in Nintex Forms

Jump to solution

Hi Katherine Collins​,

The easiest way to accomplish this is to use || to create a compound OR rule. && is used for AND.

Example:

FormControlName == 'X' || FormControlName == 'Y'

Reply
kmcollins
Nintex Newbie

Re: Show or hide controls with Rules in Nintex Forms

Jump to solution

Hi Josh,

Thanks, I found a post on logic rules for controls

Reply