Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8976477
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T19:08:54+00:00 2026-06-15T19:08:54+00:00

I am using SilverStripe 2.4.7 with DataObjectManager. I’m trying to add in my own

  • 0

I am using SilverStripe 2.4.7 with DataObjectManager. I’m trying to add in my own custom validation for the popup but something odd keeps happening. When I add my own Javascript class the date picker on my popup stops working. I can’t figure out why because the Javascript I am adding in is not applied to the data picker.

I am using

    function getRequirementsForPopup() {
       Requirements::javascript('mysite/code/js/jquery.js');
       Requirements::javascript('mysite/code/js/validation.js');
    }

to add my own Javascript class in. This worked fine in another popup but that one didn’t have a datepicker. I was under the impression that adding custom Javascript to the CMS was no problem so I’m wondering if it’s something like a conflict with the Javascript in DataObjectmanager or the Date picker.

I’d appreciate any advice anyone can offer me. I’ve seen some other posts about Javascript in SilverStripe but they don’t address what is happening here.

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T19:08:55+00:00Added an answer on June 15, 2026 at 7:08 pm

    dataobject_manager loads its own jquery file(s). When you are adding your ownsfile(s), then it is getting conflict with existing ones from dataobject_manager.

    You can see which libraries are loading from firebug. In order to do so,

    1. Open firebug
    2. Click on ‘script’
    3. Click on ‘inline’, a drop down will appear. If you type jq then all files containing jq names will be shown. It give you an idea what is being load.

    Now back to your question, If you want to use existing loaded JQuery, then add your custom file with validation code. Otherwise, here is an example how to show custom time picker (http://trentrichardson.com/examples/timepicker/)

    • First, you have to stop/block jquery files from dataobject_manager, if you planning to use your own. Something like this in getRequirementsForPopup() function. Note: It depends which files are loading and which one you want to disable after seeing loaded files in firebug.

      requirements::block(“http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.js”);
      requirements::block(“dataobject_manager/javascript/dom_jquery_ui.js”);
      requirements::block(“sapphire/thirdparty/jquery-ui/jquery-ui-1.8rc3.custom.js”);
      requirements::block(“dataobject_manager/javascript/dataobject_manager.js”);`
      requirements::block(“dataobject_manager/javascript/dataobject_manager_popup.js”);

    • Then, you have to include your own jquery files

      Requirements::javascript(‘azeem/javascript/jquery-ui/js/jquery-1.7.2.min.js’);
      Requirements::javascript(‘azeem/javascript/jquery-ui/js/jquery-ui-1.8.23.custom.min.js’);
      Requirements::javascript(‘azeem/javascript/timepicker/jquery-ui-timepicker-addon.js’);
      Requirements::javascript(‘azeem/javascript/timepicker/azeem-timepicker.js’);
      Requirements::css(‘azeem/javascript/jquery-ui/css/smoothness/jquery-ui-1.8.23.custom.css’);
      Requirements::css(‘azeem/css/timepicker/jquery-ui-timepicker-addon.css’);

    Here azeem-timepicket.js contains the custom code which you want to add to your fields

    //JQuery UI datepicker and timepicker for azeem Event End Date/Time Field
    $j('#DataObjectManager_Popup_AddForm_EventEndDate-date, #DataObjectManager_Popup_DetailForm_EventEndDate-date').datepicker({
        dateFormat: 'dd/mm/yy'
    });
    
    $j('#DataObjectManager_Popup_AddForm_EventStartDate-time, #DataObjectManager_Popup_DetailForm_EventStartDate-time').timepicker({
        timeFormat: 'hh:mm'
    });
    
    • In getCMSFields() function, you have to disable default date picker option, in case you are using date/datetime field.

      $startDate = new DatetimeField(‘StartDate’, ‘Start Date / Time’);
      $startDateField = $startDate->getDateField();
      $startDateField->setConfig(‘showcalendar’, false);
      $startTimeField = $startDate->getTimeField();
      $startTimeField->setConfig(‘showdropdown’, false);
      $fields->addFieldsToTab(‘Root.Main’, $startDate);

    • You can verify again in firebug, whether you custom and all other files are loading or not. Same things can be done for your own validation.

    Hope it will help.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using SilverStripe 2.4.7. I've done some searching but I can't seem to be able
Using the navigator.geolocation object in JavaScript. Trying to establish accurate ranges, but wondering exactly
I'm using SilverStripe 2.4.7 and I want to add a method that parses the
using this http://bl.ocks.org/950642 we can see how to add images to nodes, the question
Using mercurial, I've run into an odd problem where a line from one committer
using a binary search tree I need to add to a vector all int
I'm using 2.4.7 and I want to include some validation for two fields which
Using C# How can I show a document in richtextbox without scrollbars, But I
I'm using Silverstripe to display product items, and sometimes one product item belongs to
I'm using SilverStripe 2.4.7 and I'm wondering if there is a way to limit

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.