Jump to:

1971 Posts in 1275 Topics by 607 members

Form Questions

SilverStripe Forums » Form Questions » RequiredFields not validating

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

Page: 1
Go to End
Author Topic: 355 Views
  • quanto
    Avatar
    Community Member
    79 Posts

    RequiredFields not validating Link to this post

    Hi

    I'm trying to create a custom form in Silverstripe 3.0, but the RequiredFields ar not working. I have no idea what i'm doing wrong:

    class Product_Controller extends Page_Controller {
    static $allowed_actions = array('contactForm');

    public function init() {
    parent::init();
    }

    public function contactForm(){
    return Form::create($this, 'Form',
    new FieldList(
    new TextField('Naam', '', 'Naam'),
    new TextField('Emailadres', '', 'E-mail'),
    new TextField('Telefoon', '', 'Telefoonnummer'),
    new FormAction('zendForm', '>>')
    ), new FieldList(), new RequiredFields(array('Email', 'Telefoon'))
    );
    }
    }

    355 Views
Page: 1
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.