9 Replies Latest reply: Aug 8, 2013 7:45 PM by Liam Dilley RSS

    comments required fields

    river east Community Member

      I would like to make the comments form have the name field and email address as required fileds. What is the proper way to go about this? Any help would be appreciated.

       

      <!-- BEGIN #comments -->

      <div style="display: none;" id="comments">

      <h5> Comments</h5>

      {tag_commentspaged}

      <form onsubmit="return checkWholeForm(this)" action="/RatingProcess.aspx?OID={tag_blogpostid}&amp;OTYPE={tag_blogposttype}" method="post">

          <h5> Post a Comment</h5>

          <div class="form">

          <div class="item">

          <label> Name (required)</label>

          <br />

          <input maxlength="255" name="fullname" class="cat_textbox_small" />

          </div>

          <div class="item">

          <label> Website (optional)</label>

          <br />

          <input maxlength="255" name="website" class="cat_textbox_small" />

          </div>

          <div class="item">

          <label> Email Address (required)</label>

          <br />

          <input maxlength="255" name="emailaddress" class="cat_textbox_small" />

          </div>

          <div class="item">

          <label> Enter Word Verification in box below</label>

          <br />

          {module_captchav2}

          </div>

          <div class="item">

          <label> Your comment</label>

          <br />

          <textarea name="Feedback" class="cat_listbox_small"></textarea>

          </div>

          <div class="item">

          <input type="submit" value="Submit" />

          </div>

          </div>

          <script type="text/javascript" src="/CatalystScripts/ValidationFunctions.js"></script>

          <script type="text/javascript">

            //<![CDATA[

            function checkWholeForm(theForm) {

              var why = "";

              if (theForm.EmailAddress) if (theForm.EmailAddress.value.length > 0) why += checkEmail(theForm.EmailAddress.value);

              if (theForm.CaptchaV2) why += isEmpty(theForm.CaptchaV2.value, "Enter Word Verification in box below");

              if (why != "") { alert(why); return false; }

              return true;

            }

            //]]>

            </script>

      </form>

      </div>

      <!-- END #comments -->