achilles_aditya
Nintex Newbie

Validation Rule for the dropdown control

Jump to solution

Hi All,

I have multiple dropdowns in my form and I want to apply validation(to make dropdown value mandatory) based on a textbox (i.e. if textbox value is not null then dropdown option must be selected else dropdown selection is not mandatory) . I am following https://ootbtutorials.com/2016/02/19/rule-formula-examples-for-nintex-forms/  but validations suggested in the link are not working. Please suggest

0 Kudos
Reply
14 Replies
emha
Automation Master
Automation Master

Re: Validation Rule for the dropdown control

Jump to solution

describe what's exactly your problem, hard to guess what are you in fact trying to do...

0 Kudos
Reply
achilles_aditya
Nintex Newbie

Re: Validation Rule for the dropdown control

Jump to solution

I have updated the question

0 Kudos
Reply
achilles_aditya
Nintex Newbie

Re: Validation Rule for the dropdown control

Jump to solution

Hi Marian,

My problem is similar to validation rule on dropdown control  but isnullorempty() is not woking

0 Kudos
Reply
achilles_aditya
Nintex Newbie

Re: Validation Rule for the dropdown control

Jump to solution

In formatting rule I am checking the condition if dropdown==1 the disable the dropdown which is working fine as expected but If I change that rule to validation and click on save red border of validation do appear for a sec but item is getting saved

0 Kudos
Reply
emha
Automation Master
Automation Master

Re: Validation Rule for the dropdown control

Jump to solution

can you post how did you set up the rule?

make sure you reference control (named controls tab) in rule and not item field.

check developer console and make sure there are no errors reported.

try to put rule's condition into calculated value control and check how does it evaluate and whether it's what you expect.

if the rule is complex break it up into smallest possible pieces and try to check every singe part separatelly.

Reply
achilles_aditya
Nintex Newbie

Re: Validation Rule for the dropdown control

Jump to solution

Thanks for the reply. Actually I am seeing the weird behavior .Following are the steps performed

  1. Added a dropdown named Country with only values "India" and  "USA"
  2. Added a rule by selecting "Country" from the control tab and tried to check isNullorEmpty(Country) but the condition didn't work
  3. Added a rule  Title!= " " && (Country !="India" || Country !="USA") .This rule is working and showing the red border .
  4. After that even  if I select "India" or "USA" I am getting validation warning with red border which means the dropdown is unable to read the updated value

I wont be able to upload the screenshot due to the company policy

0 Kudos
Reply
achilles_aditya
Nintex Newbie

Re: Validation Rule for the dropdown control

Jump to solution

I created two lists with same dropdown. In one its working as expected but in another its giving syntax  error in console for the line

eval(val.clientvalidationfunction + "(val,args);");

0 Kudos
Reply
emha
Automation Master
Automation Master

Re: Validation Rule for the dropdown control

Jump to solution

I would say you have an error in some (other), or with values supplied to rule to evaluate.

let it break on error and in console examine content of 'val' and 'args' variables. it might give you a hint what's wrong.

0 Kudos
Reply
ctarr
Nintex Newbie

Re: Validation Rule for the dropdown control

Jump to solution

Hi,

If you rule is exactly like the above then your error is thrown whenever your TITLE doesn't equal a space i.e Title != " ".  It should be Title != "" without the space.  I have also found that if I use the Nintex functions of And and Or it often computes / executes more consistently than the normal scripted && and ||

Reply