Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » validation issue

Our old forums are still available as a read-only archive.

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

Page: 1
Go to End
Author Topic: 1306 Views
  • blaater
    Avatar
    Community Member
    22 Posts

    validation issue Link to this post

    Hello,

    Currently I'm building a site with silverstripe 2.1 that has lots of forms that need validation. The most of the formfields I can validate using the RequiredFields class, but I have some formelements that are only visible when the previous question is answered yes. Is it possible to create some validation that checks the previous question and when needed the validation is added?

    Thanks for your help!

  • Ingo
    Avatar
    Forum Moderator
    801 Posts

    Re: validation issue Link to this post

    hm your best bet is probably to subclass RequireFields and overload the javascript() method with your own client-side validation. unfortunately we can't directly append javascript event-handlers to a form-onsubmit because of the way our validator works.

    1306 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.