-1
When I change the event on the calendar, before changing ask to confirm: the code:
function edit(event){
start = event.start.format('YYYY-MM-DD HH:mm:ss');
if(event.end){
end = event.end.format('YYYY-MM-DD HH:mm:ss');
}else{
end = start;
}
id = event.id;
Event = [];
Event[0] = id;
Event[1] = start;
Event[2] = end;
$.ajax({
url: './updatehoradataeventoLar',
type: "POST",
data: {Event:Event},
success: function(rep) {
if(rep == 'OK'){
alert('Atividade Guardada correctamente');
}else{
alert('Tente novamente!');
}
}
});
}
This way only warns that the activity has been stored correctly, but before appearing this alert I want to appear asking if you really want to change the event, if yes changes if it is not maintains.
The answers to this question did not help me to resolve my question, because in my case, when I make the change is by dragging the event already marked and I have no button or link to add the onclick
and intended to do the same within the sucess
of ajax
Possible duplicate of Ask before deleting database data
– Woss
Before performing the entire function
edit
you wish to perform a confirmation?– Pedro Paulo
@Pedro Paulo, yes, before making change ask for confirmation if you really want to make this change
– Bruno
Then search by function
confirm
. It is the solution, not an "onclick button".– Woss
Take a look at this answer that has a
confirm
: https://answall.com/a/74705/8063– Sam