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.

General Questions /

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

Validation for Editform in the backend


Reply


5 Posts   372 Views

Avatar
khanhdeux

Community Member, 13 Posts

8 December 2013 at 6:42am

Hi team,
Do you know how to add validation to backend, i tried with getEditFrom in ModelAdmin and evene getCMSAction of class DataObject but no success. Thanks

Avatar
martimiz

Forum Moderator, 1132 Posts

9 December 2013 at 1:38am

This might help:

http://doc.silverstripe.org/framework/en/topics/form-validation#validation-in-the-cms

Martine

Avatar
khanhdeux

Community Member, 13 Posts

9 December 2013 at 1:05pm

Thanks for your help . I am a newbie in silvertripe so it would be nice if you can answer further like i had already the video module
class VideoAdmin extends ModelAdmin {

private static $managed_models = array('Video');
private static $url_segment = 'video';
private static $menu_title = 'Video';

}

HOw can i add getCMSValidator to validate the video title based on the following DataObject

class Video extends DataObject {

private static $db = array(
'VideoTitle' => 'Varchar(255)',
'VideoDescription' => 'Text',
'OwnerID' => 'Int'
);
}

Avatar
swaiba

Forum Moderator, 1808 Posts

9 December 2013 at 11:10pm

Please see the below thread...

http://www.silverstripe.org/general-questions/show/17007

Avatar
khanhdeux

Community Member, 13 Posts

10 December 2013 at 7:55am

Fantastic, you are my life saver. Thank you very much