Validation Rule on Cascading DropDown

  • 11 September 2016
  • 3 replies
  • 26 views

Badge +1

Hi, 

I need some help with a validation rule. I have 3 cascade lookup lists 

Lookup List 1 = AreaSelect 

Look Up List 2 = CostCodeName

Look Up List 3 = CostCodeNumber 

Once the form is loaded, the 1st lookup, AreaSelect field isn't mandatory, however any item selected in AreaSelect that is populated i.e (VIC, TAS, NT NSW, WA, SA, QLD) CostCodeName is automatically mandatory. As there a more then one CostCode Name in a Area. Once CostCodeName is selected, CostCodeNumber is automatically mandatory. 

I'm confused on the logic will work with a validation, so any help would be appreciated. 

Also the 3 dropdowns have the default "Please Select Value", would this cause the validation to not work?


3 replies

Badge +16

Hi

I have a form with three list lookup controls. 

First one points to list luAreaSelect

Second one points to list luCostCodeName

Third one points to list luCostCodeNumber

I have no validation on the first one.

On the second one I have the following validation rule:

I have the same on the third control (but pointing to luCostCodeName control instead of luAreaSelect control).

This rule says that if {self} (i.e. the control the rule is on) is blank but that the named control luAreaSelect is NOT null (i.e. a value was selected) then it is invalid. This validation will only fire on Save.

If you want it to appear without save you will need to add some javascript custom validation code.

Badge +1

Hi Casey

Thanks for your tip with the drop downs. i appreciate your help happy.png

I had tried to hit save on the form and it luCostCodeName automatically became mandatory, which is not an requirement. 

I have tried your rule, however the lookup field luAreaSelect has the default "Please select value.." which makes the rule on luCostCodeName automatically validated without picking an option in luAreaSelect.

191848_pastedImage_2.png

Is there a way to disable the wording in the lookup or change the validation to exclude the wording "please select value.."

Thanks 

Danielle

Badge +16

is your validation rule exactly the same?  i had the "Please select a value..." as default in my lookups too.  Can you screenshot the rules you have on each control please?

you can also add a calculated value control to your form with the value of the named controls to check that "Please select a value..." actually has no value itself.

Reply