hi,

I have created a drop down box and have added the data from my database.
Now i have repeated values inside drop down since its being retrieved from database directly.I want those repeated values to be removed.

For instance,

My drop down values are retrieved from database called fruits and apple has been repeated twice. Now i need the apple to be displayed only once. This must be done using javascript.

Thanks.

Recommended Answers

All 2 Replies

What I would do: make a var options = [] , loop through all the options, check if it is in your array, if so, remove it, if not, put it in the array.

hi twiss,

Thanks for your suggestion! will work on it.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.