Skip to main content

Hi Everyone,

I am having an issue making a rule to show/hide a control box. I have represented my situation with the example below.

Lets say I have BoxA which is a Choice Control with selections Left, Right, Center. I have BoxB which is a single line textbox Control and I have BoxC which is a single line textbox Control.

I want BoxB to become visible only when BoxA selection is either Left or Right or if BoxC contains the letters ‘CNVL’.

I also want BoxB to be required to have data in it, if it becomes visible.

Thank you.

Hi,



What kind of Nintex form you are using? Classic/Responsive/New Responsive?


"Responsive" is what I am using. 


Looks tricky, what if user selects "Center" and enters "CNVL" in BoxC? 



And you can create a "Mandatory" rule with rule,



When



BoxA = "Left" || BoxA = "Right" || contains("CNVL", "controlname") 



Then



Invalidate



Validation Message 



Please enter data in "controlname"


Thanks, I am looking into your suggestions above. One question: How do you make a Contains() function a Does Not Contains()?

Hi,



You have to negate the contains() function, like 



not(contains("CNVL", "controlname")) or   !contains("CNVL", "controlname")


I have not been successful on finding a solution to my original question. I am now trying to use validation in the control settings-see below.



The regular expression I am using is below:



 



fn-Contains(Material#,"cnvl") && fn-IsNullOrEmpty(Suborder)



 



It works, however, when "cnvl" is contained and when a number is entered in Suborder, the regular expression error message does not clear. I evidently do not have my expression written correctly.



 



Thanks



 





 


Hi Scott,



Apply the same formula as a "Rule" on "Material" control, it should work.



And I noticed the name of the control is "Material" and the function, fn-contains() refers it as "Material#", has Nintex added the "#" to the control name? Make sure the control name referred is correct in the fn-contains() function.


Awesome! Thanks! That worked like a charm!

Reply