Validation rule on all fields/controls in Panel


Badge +3

Hello All,

I have a Panel containing 10 fields, I would like to know if it is possible to make them all mandatory based on a number of possibilities from a drop down list.

For example, If dropdown has a value of A or B then all fields in the panel are mandatory

Any thoughts?

Thanks


6 replies

Userlevel 5
Badge +14

yes you can achieve what you ask for.

select all the controls you want to validation for and 'Add new rule' for them.

or if you already have the rule created use 'Assign rulle to selected control' option to apply it to further controls.

for exact form of validation formula it's important to know whether dropdown control is backed by a choice or lookup control type.

Badge +3

Thanks Marian.

The problem with doing that from what I can see with my limited knowledge, it that it can get a little messy. Each rule would be different to reference that field. For example

isNullOrEmpty(Field1) && (DROPDOWN=="A" || DROPDOWN=="B")
isNullOrEmpty(Field2) && (DROPDOWN=="A" || DROPDOWN=="B")
isNullOrEmpty(Field3) && (DROPDOWN=="A" || DROPDOWN=="B")

etc.

Unless I am missing something.

Thanks

Userlevel 5
Badge +14

at the end of 'Named controls' list there is a {Self} reference which is replaced with actual value of control a rule is being evaluated on

205849_pastedImage_1.png

so you should be able to buil single formula like

isNullOrEmpty({Self}) && (DROPDOWN=="A" || DROPDOWN=="B")
Badge +3

Excellent, thank you Marian. Feel free to take the rest of the day off ☺

Userlevel 5
Badge +14

if it worked for you please mark correct answer.

the day off would be fine, but I'm not so lucky happy.png

Userlevel 5
Badge +14

could you mark as correct my above post with a solution to your original question?

that helps other users with the same question/problem to find correct answer quickly.

thanks.

Reply