"Date field" in form works while signed in, not while on live site.

Permalink
The "date field" which should pop up a calendar works and does what is expected if I am signed in to the site (can see the admin bar across the top) if I am signed out it becomes just a regular input with no popup.

The only thing I am hiding when in edit mode is this:

<?php
    $page = Page::getCurrentPage();
    if(!$page->isEditMode()) {
?>
    <script src="<?php echo $view->getThemePath()?>/js/bootstrap.min.js"></script>
<?php } ?>


However if I set it to not load even on the live site the date field still doesn't work.

Version 5.7.4.2

omniomi
 
hutman replied on at Permalink Best Answer Reply
hutman
When you are not logged in to the site jquery is not loaded, you need to make sure that you require it on your page.

$this->requireAsset('javascript', 'jquery');
omniomi replied on at Permalink Reply
omniomi
That did it... I was loading my own copy of jquery but apparently that was insufficient...

Cheers.