Making the email field in comments required

Posted by Community Admin on 04-Aug-2018 02:06

Making the email field in comments required

All Replies

Posted by Community Admin on 13-Sep-2017 00:00

I'm trying to add validation to the email field of the built in comments module. Specifically to make the email field a required field.

 

I've modified the "Comments submit form" widget template, by adding the validation fields from the name field to the email field.

<sfFields:TextField ID="nameTextField" runat="server" DisplayMode="Write" CssClass="sfcommentsField" WrapperTag="Li" TabIndex="1">
                    <ValidatorDefinition
                        Required="true"
                        RequiredViolationMessage="Name cannot be empty!"
                        MessageCssClass="sfError" />
                </sfFields:TextField>
                <sfFields:TextField ID="emailTextField" runat="server" DisplayMode="Write" CssClass="sfcommentsField" WrapperTag="Li" TabIndex="1">
                    <ValidatorDefinition
                        ExpectedFormat = "EmailAddress"
                        Required="true"
                        RequiredViolationMessage="Email cannot be empty"
                        MessageCssClass="sfError" />
                </sfFields:TextField>

 

This doesn't have any affect on submitting the form.

How can I get the form the validate the email field?

This thread is closed