I have a situation where I am utilizing fullCalendar, but I need it to go to a new page with some POST info and not utilize AJAX.
I simply am trying to make it so when the event is clicked it is sent to a new page with some POST info. Below is the code with the last line being an attempt to send info through a URL, but if there is any way of sending the info via a POST with AJAX instead to the page that could work too.
$(document).ready(function() {
var calendar = $('#calendar').fullCalendar({
editable:false,
header:{
left:'prev,next today',
center:'title',
right:'month,agendaWeek,agendaDay'
},
events: 'Calander_inc/load.php',
selectable:true,
selectHelper:true,
select: function(start, end, allDay)
{
var title = prompt("Enter Event Title");
if(title)
{
var start = $.fullCalendar.formatDate(start, "Y-MM-DD HH:mm:ss");
var end = $.fullCalendar.formatDate(end, "Y-MM-DD HH:mm:ss");
$.ajax({
url:"insert.php",
type:"POST",
data:{title:title, start:start, end:end},
success:function()
{
calendar.fullCalendar('refetchEvents');
alert("Added Successfully");
}
})
}
},
editable:true,
eventResize:function(event)
{
var start = $.fullCalendar.formatDate(event.start, "Y-MM-DD HH:mm:ss");
var end = $.fullCalendar.formatDate(event.end, "Y-MM-DD HH:mm:ss");
var title = event.title;
var id = event.id;
$.ajax({
url:"update.php",
type:"POST",
data:{title:title, start:start, end:end, id:id, url:url},
success:function(){
calendar.fullCalendar('refetchEvents');
alert('Event Update');
}
})
},
eventDrop:function(event)
{
var start = $.fullCalendar.formatDate(event.start, "Y-MM-DD HH:mm:ss");
var end = $.fullCalendar.formatDate(event.end, "Y-MM-DD HH:mm:ss");
var title = event.title;
var id = event.id;
$.ajax({
url:"update.php",
type:"POST",
data:{title:title, start:start, end:end, id:id},
success:function()
{
calendar.fullCalendar('refetchEvents');
alert("Event Updated");
}
});
},
eventClick:function(info)
{
var id2 = event.id;
window.open("Calander_inc/see-info.php?idgig=" + encodeURI(id2),"_self");
},
eventRender: function(event, element) {
$(element).tooltip({title: event.title});
}
});
});
</script>
title, start, end, id, url
into say input boxes in a form and submit by POST – Ken Lee