jimfog Posted June 16, 2014 Share Posted June 16, 2014 I have created a loop that creates a dropdown menu, a menu of timestamps, for reasons of clarity though I have created this fiddle http://jsfiddle.net/fiddlehunt/5WVKz/ where the menu is comprised of numbers 1-10, And here is the problem: As you will see in the fiddle the append() method is used. The problem is that whenever the function that creates the loop gets called...the created numbers are added to the numbers that where created with the previous function call. So. when the menu is opened(and if for example the function has been called twice) I see two times 1-10. Unfortunately I cannot replicate the behavior with jsfiddle. How can I fix it? Link to comment Share on other sites More sharing options...
justsomeguy Posted June 16, 2014 Share Posted June 16, 2014 Remove all options before adding any. Link to comment Share on other sites More sharing options...
jimfog Posted June 17, 2014 Author Share Posted June 17, 2014 Yes,you are right. I had tried it but the implementation/logic was wrong-I tried now a different logic and it worked. Probably,creating a topic about it,was not even necessary. Link to comment Share on other sites More sharing options...
Day Posted June 18, 2014 Share Posted June 18, 2014 (edited) Probably,creating a topic about it,was not even necessary. Sometimes it helps just to type it out, write it down, or say it out loud to help facilitate the problem solving process. If you saw my notebook at work, you might think I was crazy. Edited June 18, 2014 by Day Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now