This article describes how to apply form rules to custom form fields.
First you create a new fields for the form, using procedure Create new input fields for forms, then, you make the field to support rules.
The Controller must be implemented the following two interfaces:
ISupportRules
Dictionary<ConditionOperator, string>
ConditionOperator
ITextField
ISubmitFormField
ISectionHeaderFormField
IParagraphFormField
IFileFormField
ICaptchaFormField
IDropDownFormField
IEnumerable<string>
IMultipleChoiceFormField
ICheckboxFormField
In the Model, you must implement IHideable to allow show and hide actions of that field.
IHideable
For the field that participates in conditions, you must implement the following:
data-sf-role="<wrapper_container>"
data-sf-role="<element_selector>"
FormRulesSettings
FormRulesSettings.addFieldSelector("<field_wrapper_container>", "[data-sf-role='<field_element_selector>']", "<additional_filter>")
<field_wrapper_container>
[data-sf-role='<field_element_selector>']
<additional_filter>
Sign up for our free beginner training. Boost your credentials through advanced courses and certification. Register for Sitefinity training and certification.
To submit feedback, please update your cookie settings and allow the usage of Functional cookies.
Your feedback about this content is important