Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Can you give me a simple example of using the requiredif Validator rule?

rule simple Validator
0
Posted

Can you give me a simple example of using the requiredif Validator rule?

0

First off, there’s an even newer Validator rule called validwhen, which is almost certainly what you want to use, since it is much easier and more powerful. It will be available in the first release after 1.1 ships. The example shown below could be coded with validwhen as:

test ((((sex == ‘m’) OR (sex == ‘M’)) AND (*this* == null)) OR (*this* != null)) Let’s assume you have a medical information form with three fields, sex, pregnancyTest, and testResult. If sex is ‘f’ or ‘F’, pregnancyTest is required. If pregnancyTest is not blank, testResult is required.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123