Drop-down valiation in Document (Page) Type field

Brian Plester asked on August 3, 2015 11:53

Hi, I have a Doucument (Page) Type with a Text field which uses a Drop-down list form control. The control is populated as a List of 3 options: {% GetResourceString("IMPleaseSelectATopic") %} Cloud Services Managed Services

How do I validate that the selectedIndex is > 0? I tried creating a validation rule with a "General condition" and text of selectedIndex = 0 and I also tried selectedIndex == 0 but I get an error at run-time irrespective of which element was selected in the drop-down.

Correct Answer

Dawid Jachnik answered on August 3, 2015 12:04

Hello Brian, you can achive this by disabling allow empty value and by using this types of option:

;{% GetResourceString("IMPleaseSelectATopic") %}
Cloud Services;Cloud Services
Managed Services;Managed Services

The first one value is empty so the control will be validated for emptiness

2 votesVote for this answer Unmark Correct answer

Recent Answers

Brian Plester answered on August 3, 2015 12:14

Thanks Dawid, just prefixing the first line with ";" works :-)

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.