I have the following code, where I want to send a variable to PHP to filter events on the calendar:
$(document).on('click', '.cons-visitt', function(){
if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {
initialViews = 'listWeek';
}else{
initialViews = 'listWeek';
}
var Datavisitt = $("#Datavisitt").val();
var calendarEl = document.getElementById('calendarioo');
var calendar = new FullCalendar.Calendar(calendarEl, {
headerToolbar: {
left: 'prev,next today',
center: 'title',
right: 'listWeek'
},
locale: "pt-br",
buttonText:{
today: 'Hoje',
list: 'Lista'
},
events: '/visitas1.php?Datavisitt',
});
calendar.render();
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<form method="POST" class="row g-3 vistutentt">
<div class="col-md-3">
<label for="Datavisitt" class="form-label">Inicio de Registo </label>
<input type="date" class="form-control" name="Datavisitt" id="Datavisitt" value="<?php echo date("Y-m-d");?>">
</div>
<div class="col-2">
<button type="button" class="btn btn-info cons-visitt" style="float: right; margin-right: 5%; margin-top: 4%;"><i class="metismenu-icon pe-7s-search"></i> Consultar </button>
</div>
</form>
<div id='calendarioo'></div>
I want to send the value of this variable to PHP:
var Datavisitt = $("#Datavisitt").val();
and I'm trying it this way:
events: '/visitas1.php?Datavisitt',
But the variable in php is always NULL
. Can you help?
source https://stackoverflow.com/questions/77362049/send-fullcalendar-variables-to-php
No comments:
Post a Comment