Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

DataObjectManager Module /

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Validation in DOM

Go to End

2 Posts   954 Views


Community Member, 66 Posts

17 November 2012 at 6:34am

SilverStripe 2.4.7


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?



Community Member, 66 Posts

20 November 2012 at 10:43pm

Edited: 21/11/2012 1:00am

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

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';