How to enable the validation for check box list (Choose Fiel

Posted by Community Admin on 05-Aug-2018 22:23

How to enable the validation for check box list (Choose Field) for a custom Dynamic Module using Sitefinity 8.0

All Replies

Posted by Community Admin on 10-Apr-2015 00:00

Hi,

I'm new to the Sitefinity (V8.0) and I'm working on adding some new Content Types using Administration > Module Builder and I have to include a Check box List/Drop down list with validation such that content author should select a option before Publishing the content and I don't see any settings to do so. 

Any help is appreciated.

Thanks.

Posted by Community Admin on 13-Apr-2015 00:00

I Found the solution under Advance > DynamicModules > Controls > CustomContentType > Views > CustomBackendInsertView >  Sections > MainSection > Fields > Departments (Choice Field) > Validation  and make the field "Required" as True and also enter some validation message under "Required Violation message" field. Repeat above steps for CustomBackendEditView as well if required for existing content.

With the solution found above, 50% of my work is completed but I also need to TURN ON  "Yes/No" (make the checkbox selected) field value by default. I tried modifying the advance settings as I did for "Choose field" but no help. Here is the xml from the "DynamicModuleConfig.config":

<field mutuallyExclusive="False" renderChoiceAs="SingleCheckBox" hideTitle="False" returnValuesAlwaysInArray="False" id="BoolValControl" dataFieldName="BoolVal" displayMode="Write" wrapperTag="Li" title="Bool val" fieldType="Telerik.Sitefinity.Web.UI.Fields.ChoiceField, Telerik.Sitefinity" cssClass="sfFormSeparator Uttam" fieldName="BoolVal" type:this="Telerik.Sitefinity.Web.UI.Fields.Config.ChoiceFieldElement, Telerik.Sitefinity">
                                    <choicesConfig>
                                        <element text="Bool val" value="Bool val" enabled="True" selected="True" />
                                    </choicesConfig>
                                    <validator expectedFormat="None" maxLength="0" minLength="-1" regularExpression="^(.0,)?$" required="True" maxLengthViolationMessage="The input is too long" messageCssClass="sfError" minLengthViolationMessage="The input is too short" validateIfInvisible="True" />
                                    <expandableDefinition expanded="True" />
                                </field>

 

Thanks.

 

 

 

 

This thread is closed