I'm quite bad at javascript and jquery. I need help solving this task.
How do I display/show the calendar based on selected month and year from this form.
<form class="navbar-search" action="search.php?id=<?= $id ?>" method="post">
<div class="row">
<div class="col">
<label for="year">YEAR:</label>
<input name="year" value="<?=$year?>" class="form-control form-control-user" id="yearpicker" placeholder="Please Choose..." autocomplete="off">
</div>
<div class="col">
<label for="month">MONTH :</label>
<input name="month" value="<?=$month?>" class="form-control form-control-user" id="monthpicker" placeholder="Please Choose..." autocomplete="off">
</div>
</div><br>
<button name="search" id="search" type="submit" class="btn btn-primary btn-user btn-block"><i class="fas fa-search fa-sm"></i> SEARCH</button>
<hr>
</form>
I'm using customise datepicker in this form input btw.
And here's the calendar:
This is the js/jquery that should call the calendar. But I have no idea how and where to send the year and month value to the calendar.
$(document).ready(function() {
$('#calendar').fullCalendar({
editable: true,
events: "fetch-event.php?id=<?php echo $id ?>",
displayEventTime: false,
eventRender: function(event, element, view) {
if (event.allDay === 'true') {
event.allDay = true;
} else {
event.allDay = false;
}
},
});