Jump to:

7935 Posts in 1536 Topics by 943 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » Validation in DOM

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Page: 1
Go to End
Author Topic: 548 Views
  • Stef87
    Avatar
    Community Member
    66 Posts

    Validation in DOM Link to this post

    SilverStripe 2.4.7

    Hi

    I'm looking for a way to validate the fields in my DOM popup. I need to, firstly, ensure that they have all been filled in. Next I need to make sure they are correct using Regular Expressions or something. I am ok with the regex but how do I go about applying validation to the fields?

    Thanks

  • Stef87
    Avatar
    Community Member
    66 Posts

    Re: Validation in DOM Link to this post

    I've been trying to implement what these posts talk about but it has no effect.

    http://www.silverstripe.org/data-model-questions/show/6128
    http://www.silverstripe.org/customising-the-cms/show/8236

    Even basic validation using the following does nothing.

    public function getCMSValidator() {
       return new RequiredFields(array('Title', 'Expires', 'Photo', 'Description', 'Weight', 'Price', 'Savings', 'Code'));
       }

    When I try to add a new popup class I get this error

    Class 'MyDataObjectManager_Popup' not found in /Applications/MAMP/htdocs/Gala/Gala/trunk/cms/sapphire/forms/ComplexTableField.php on line 600

    I'm using

    MyDOM->popupClass = 'MyDataObjectManager_Popup';

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