1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Making the email field in comments required

Making the email field in comments required

1 posts, 0 answered
  1. Charles
    Charles avatar
    0 posts
    Registered:
    11 Nov 2016
    13 Sep
    Link to this post

    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?

1 posts, 0 answered