The Dewey Decimal Classification (DDC) is a really useful method to classify books and texts. So I’m trying to find a triple drop down menu that implements it. I googled it in many different ways but couldn’t find any.
I’ve seen long time ago the double drop down menu and recently the triple drop down menu, so I COULD implement this for myself. Thought my lucky guess is, not knowing too much about javascript, that I could spend MANY hours of really hard work to implement it.
Therefore, my question. Do you know where I can find an already made javascript code for a dropdown menu implementing the DDC? Also, it needs NOT to redirect to another page when you select all the fields since it’s for a submit page where other fields are required. This could be hacked thought.
If instead of the DDC you posted some code with the Universal Decimal Classification that’d also be valid. It’s just I prefer the DDC.
If I don’t find it anywhere, I’ll try to do it myself and publish the code.
It should work in this way: The first drop down has these options:
- Computer science, information and general works
- Philosophy and psychology
- Religion
- Social sciences
- Language
- Science (including mathematics)
- Technology and applied science
- Arts and recreation
- Literature
- History and geography
If you selected, let’s say, “Science”, then the second drop down menu would acquire these values:
- Sciences
- Mathematics
- Astronomy & allied sciences
- Physics
- Chemistry & allied sciences
- Earth sciences
- Paleontology; Paleozoology
- Life sciences
- Plants
- Zoological sciences/Animals
And let’s say that now you choosed “Physics”, then the third drop-down menu would be like this:
- Classical mechanics; Solid mechanics
- Fluid mechanics; Liquid mechanics
- Gas mechanics
- Sound & related vibrations
- Light & paraphotic phenomena
- Heat
- Electricity & electronics
- Magnetism
- Modern physics
If you selected “Heat”, then the value of the drop down menu would be: opt1=5, opt2=3, opt3=6, as “Heat” corresponds to 536.
You can see the full structure in Wikipedia.
It took less time than expected as javascript ‘advanced’ code was really similar to other programming languages. Just about 20h with the help of some bash script not to do repetitive tasks manually. I really DON’T think it’s a good idea to paste about 3000 lines of javascript here, so, as I requested in the first place, I post the html here and also THIS LINK to the ddc.js. Also, you can test it here and see the explanation there. Both links are from my page and there’s some light php involved that I won’t post as it’s not too relevant (explained in the second link in the NOTE).
Html: