cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Nintex Newbie

How to set up a mandatory field based on choice ?

Jump to solution

Hello,

I have some issues with my form.

Goal : I want to set up a mandatory field a dropdown when a specific choice value is selected, same thing when I select another choice.

Context :

My choice control have 2 choices : A and B for example.

In the same repeating section, I have my dropdown(e.g dd) and my textbox (e.g tb).If I chose A, tb is hidden and dd displayed. If I chose B, tb is displayed and dd is hidden.

Can you help me to set up a mandatory rule ?

BR

Théo

Reply
5 Replies
Highlighted
Nintex Employee
Nintex Employee

Re: How to set up a mandatory field based on choice ?

Jump to solution

Hello Theo Delsante​ -

This is entirely doable using Nintex Forms and some simple validation rules. I provided an export of what I did so that you can follow along if needed.

First off, I created this on a list with the following columns:

  • Title - not required
  • Choice (Choice field)
    • Dropdown Required
    • Textbox Required
  • Dropdown (Choice Field)
    • A
    • B
    • C
  • Textbox (Single Line Text)

The form will require that a selection is made from Dropdown when "Dropdown Required" is selected from Choice. Conversely, it will require that something be in Textbox if "Textbox Required" is selected from Choice.

I dropped the Dropdown and Textbox controls into panels so that it is easier to manage the rules that are applied to them. On the Dropdown panel, I placed the following rule:

This will Hide the panel if "Dropdown Required" is not selected. As you can guess, setup a similar rule on the Textbox panel to do the same thing like so:

This takes care of hiding and showing the controls based on the Choice selection. Now to add in the validations.

Select the Dropdown control and add the following rule:

This will check Choice to see if it equals "Dropdown Required" AND if Dropdown is empty. If TRUE, it will cause validation and not allow the user to submit:

Now for the Textbox control. Same approach; select the control and add the following validation rule:

Again, it will check Choice to see if it equals "Textbox Required" AND if Textbox is empty. If TRUE, it will cause validation and not allow the user to submit:

From here you can drop these controls into a repeating section and alter the message that will appear.

Hope this helps!

View solution in original post

Reply
Highlighted
Nintex Newbie

Re: How to set up a mandatory field based on choice ?

Jump to solution

Thank Jesse, I test it tomorrow and I get back to you with my feedback.

Reply
Highlighted
Nintex Newbie

Re: How to set up a mandatory field based on choice ?

Jump to solution

It works fine !

Thanks

Théo

Reply
Highlighted
Nintex Employee
Nintex Employee

Re: How to set up a mandatory field based on choice ?

Jump to solution

Excellent  I am glad it worked out for you!

0 Kudos
Reply
Highlighted
Nintex Newbie

Re: How to set up a mandatory field based on choice ?

Jump to solution

Hi Jesse, 

 

Is this also possible to apply the below to multiple fields dependant on the a choice. This formula has worked for a single field but I am struggling to apply this to multiple fields dependant on choice.

For example, If the choice is made for Textbox Required then a number of Text Boxes would require some input. 

In my scenario, I am creating a digital request form for user management so if the 'New User' selection is made from the Dropdown then I need the 'New User Name' / 'Job Title' / 'Department' / 'Location' fields to be completed. 

Further to this if the selection for 'Change User' is chosen from the Dropdown then 'Existing User Name' / 'Job Title' / 'Department' / 'Location' fields would need to be mandatory etc. 

 

Thank you in advanced. 

0 Kudos
Reply