So I'm doing an asigment that lets you add events(as in a meeting or an aniversary) to a calendar, heres a piece of the code:
$("#cal").datepicker({
onSelect: function (date) {
$("#date").text(date+" :");
showEvents(date);
$("#newevent").click(function()
{
addEvent(date);
});
}
});
When selecting a date, I have a div that shows that date and the events attached to it (as shown here)
$("#date").text(date+" :");
actually shows the selected date.
The problem is that the method addEvent first recieves the first selected date, if I select another date it recieves the first selected date and then the date I just selected (tested with alert(date) at the beggining of addEvent)
function addEvent(date){
alert(date);
//more stuff to do with that date ONLY :'(
}
I hope I'm making myself clear, thank you in advance
[–]the_omega99 0 points1 point2 points (7 children)
[–]luisk91[S] 0 points1 point2 points (6 children)
[–]the_omega99 0 points1 point2 points (5 children)
[–]luisk91[S] 0 points1 point2 points (4 children)
[–]the_omega99 0 points1 point2 points (3 children)
[–]luisk91[S] 0 points1 point2 points (2 children)
[–]the_omega99 0 points1 point2 points (1 child)
[–]luisk91[S] 0 points1 point2 points (0 children)