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

Making the email field in comments required

The forums are in read-only mode. In case that you want to directly contact the Progress Sitefinity team use the support center. In our Google Plus group you can find more than one thousand Sitefinity developers discussing different topics. For the Stack Overflow threads don’t forget to use the “Sitefinity” tag.
1 posts, 0 answered
  1. Charles
    Charles avatar
    0 posts
    Registered:
    11 Nov 2016
    13 Sep 2017
    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