Answer the question
In order to leave comments, you need to log in
Layout of drop-down lists
When you need not just a drop-down list, but a beautifully designed drop-down list, layout designers use various javascripts. All of these scripts work in much the same way. The select tag is replaced with a bunch of div tags. The simplest actions - the selection of an element of the list is performed. But if we need a little more complicated, for example, to attach a function to the onchange drop-down list event, then this no longer works. Tell me how this problem is solved or in which scripts for registration of additional downs, this problem was initially solved.
Answer the question
In order to leave comments, you need to log in
If you replace the list with a bunch of divs, then you will no longer need to process onchange, but, for example, onclick on the div, and, optionally, change the list there so that onchange works. Something like this.
In jQuery, for example (I think in any other serious framework), you can fire events custom. For example, here is the jQuery custom selectboxes plugin . If specifically on this page to execute:
$('#default-usage-select').change(function() { alert(this.value); });
here you can choose what you like - www.queness.com/post/204/25-jquery-plugins-that-enhance-and-beautify-html-form-elements
I personally like this one the most - www. dfc-e.com/metiers/multimedia/opensource/jqtransform/
I think it's not a problem to write a function for the drop-down list event yourself.
When using jquery, you can generate an event yourself via trigger('change').
And why do you need selects at all with such Wishlist? Javascript and hidden field. All hooks are in javascript.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question