Jump to:

23371 Posts in 18161 Topics by 2865 members

General Questions

SilverStripe Forums » General Questions » Page Comments Required Fields / Validator?

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1 2
Go to End
Author Topic: 2073 Views
  • Pix
    Avatar
    Community Member
    130 Posts

    Re: Page Comments Required Fields / Validator? Link to this post

    OK, I realize this post is pretty old, but something else came up. Anyway, here goes:

    So I was looking at modifying the PageCommentInterface.php, but then I saw in the code it looks like it is already setting Name and Comment as required fields with new RequiredFields:

    $form = new PageCommentInterface_Form($this, "PostCommentForm", $fields, new FieldSet(
             new FormAction("postcomment", _t('PageCommentInterface.POST', 'Post'))), new RequiredFields('Name', 'Comment'));

    That would be just fine with me, the problem is that I am able to submit a completely blank comment, no name, no comment. What could be the problem here? I have added an e-mail field to page comments using the tutorial from ssbits:

    http://www.ssbits.com/tutorials/2010/adding-an-email-field-to-the-page-comment-form/

    Could that have something to do with it? Maybe I need to add validation a different way?

    Thanks for any help....

  • Pix
    Avatar
    Community Member
    130 Posts

    Re: Page Comments Required Fields / Validator? Link to this post

    Anyone anyone? Anyone else having this issue?

    2073 Views
Page: 1 2
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.