I’ve spent way too long on this and I’m going nowhere so I’m here to ask for help.
All I want to do is execute some JS to so that the Juidateselector is pre-populated.
I’m using the following code:
$(function(){
$("#start_date_visible").datepicker('setDate', new Date());
});
When I enter it in the FF console after the page has loaded it works as intended. However, it does not work when I try to use it inline:
<script type="text/javascript">
$(function(){
$("#start_date_visible").datepicker('setDate', new Date());
});
</script>
or when I put it into an extra JS file and load the JS in the layout/main.php or in the view that calls the renderPartial. The field I’m trying to populate is created as part of this call:
<?php
$this->renderPartial('application.views.components.dateselect');
?>
Is that the source of my troubles? I’m totally lost and would really appreciate some pointers.
Thanks for taking the time