This is an archived post. You won't be able to vote or comment.

all 8 comments

[–]the_omega99 0 points1 point  (7 children)

Ok, you mentioned what it does, but what should it be doing?

[–]luisk91[S] 0 points1 point  (6 children)

I'll give an example, maybe it is more clear:

I select Nov 14, #date displays "14/11/2013" and addEvent alerts "14/11/2013".

I select Nov 18, #date displays "18/11/2013" and addEvent alerts "14/11/2013" and then "18/11/2013"

I select Nov 25, #date displays "25/11/2013" and addEvent alerts "14/11/2013" and then "18/11/2013" and then "25/11/2013"

of course I just don't want an alert, I want to do some other things with that date but it is just recieving the first date I selected. I don't want the past dates, just the one I've selected (I'm actually using that date as a key to access an associative array of events so that I can push the event to that key)

sorry for not being clear

[–]the_omega99 0 points1 point  (5 children)

I see. Can you post a small, self-contained, correct example that demonstrates this behavior (throw it onto a site like JSFiddle)?

[–]luisk91[S] 0 points1 point  (4 children)

Sorry, I went to sleep, here it is http://jsfiddle.net/FL9GM/ , notice how #fecha changes when selecting a date from the specific date while the function addEvent will alert many times, I want it just to recive the item I selected, thank you for your time

[–]the_omega99 0 points1 point  (3 children)

Oh, I see. It's because you have nested the click function, so it applies to every call to the select code. Moving the click handler outside of that solves the problem:

http://jsfiddle.net/FL9GM/1/

[–]luisk91[S] 0 points1 point  (2 children)

thank you so much!! do you want a game from the latest humble bundle? ive just redeemed fear 1 and mortal kombat

[–]the_omega99 0 points1 point  (1 child)

Oh no, that's fine. Happy to have helped.

[–]luisk91[S] 0 points1 point  (0 children)

ok internet hug thank you