In this tutorial you will learn how to create a form with ConfiForms which will have:
fields with custom validation rules based on the selected value in other field
We will validate the value as email when "Email" is selected and we will validate the same field as required when "Address" is selected in the dropdown
Error rendering macro 'excerpt-include'
No link could be created for 'Creating a simple form'.
Pieces of a puzzle (how it looks like in the Confluence editor)
We have simple form (ConfiForms Form), 2 fields (2 ConfiForms Field definitions), 1 ConfiForms Registration Control and 2 ConfiForms Field Definition Rules macros
Let's see in more details how the "type" field is configured:
It is a dropdown field with 2 choices: numbers (Numbers only) and letters (Letters only)
Next important bit is 2 ConfiForms Field Definition Rules macros and their configurations. Both rules are set to track "val" field and executed based on a condition, meaning based on the selection made in the "type" field. See screenshots below
And here is how the form behaves when validation fails
When validation is successful the record is saved into the form storage, otherwise the appropriate error message is shown