Skip to content

Latest commit

 

History

History
50 lines (35 loc) · 1.42 KB

README.markdown

File metadata and controls

50 lines (35 loc) · 1.42 KB

jquery.biglist.js

Given a 'template' <select> box with hundreds of options, allow many other ` boxes to use the contents instead when they are clicked. For instance, say you have a page with 200 "users", and each of them has as an "emergency contact" select box, a "BFF" select box, and a "arch nemesis" select box, all of which, when clicked, should allow you to select any of the other users If you generate this all as standard HTML, then you're soon going to have staggeringly huge pages. With this plugin, you can have a single "users" selectbox (hidden somewhere), and the contents of that are loaded into each of the other boxes when the user clicks on it. It's intended for use in pages generated by server side code of some sort, but I'm sure you can find other uses for it! example: html: <select id="template"> <option value="banana">Banana!</option> <option value="peach">Peach!</option> <option value="apple">Apple!</option> <option value="durian">Durian!</option> </select> <label>Favourite Fruit: <select class="use_tmpl"><option value="banana">Banana!</option></select></label> <label>Most Smelly Fruit: <select class="use_tmpl"><option value="durian">Durian!</option></select></label> JS: $('select.use_tmpl').biglist('#template'); Licence: MIT. Status: First version, call it beta, alpha, testing, whatever.