Jump to:

7935 Posts in 1536 Topics by 943 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » Dataobjectmanager Popup Validation Code

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: 539 Views
  • Stef87
    Avatar
    Community Member
    66 Posts

    Dataobjectmanager Popup Validation Code Link to this post

    SilverStripe 2.4.7

    Hi

    I am using Dataobjectmanager and am trying to find a way to include validation on the popup. I was rooting through the code and came across this.

    parent::__construct($controller, $name, $fields, $actions, $validator);
        if ($this->validator instanceof Validator) {
       $this->validator->setJavascriptValidationHandler('none');
          }
          else {
       $this->unsetValidator();
       }


    (lines 859-865 of DataObjectManager.php)
    I'm confused about what this code is actually doing. I know it is calling the constructor and then checking for an instance of Validator but why is it setting the JavascriptValidationHandler to 'none'?

    Thanks

  • Stef87
    Avatar
    Community Member
    66 Posts

    Re: Dataobjectmanager Popup Validation Code Link to this post

    Ok so I've found out how to add a required fields type of validation to DOM popup thanks to this post. What I want to do now is add validation which ensures that a url is in url format and a price is a currency symbol followed by numbers.

    Any suggestions? I've been searching online and in the code to no avail.

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