jquery - Change event for a multiple select -


i fire code when number of option elements within multi select changes.

here html looks like:

<select id="id_foods_to" multiple="multiple" size="0" name="foods" class="filtered">     <option value="1">stuff</option>     <option value="2">more stuff</option> <select> 

and here code wrote failed accomplish goal:

$("#id_foods_to").change(function () {      alert('success!');  }); 

also, i'm using http://bitkickers.blogspot.ca/2010/05/reuse-djangos-filterhorizontal-admin.html

you code works, delete select ending tag in first line..

<select id="id_foods_to" multiple="multiple" name="foods" class="filtered">     <option value="1">stuff</option>     <option value="2">more stuff</option> </select> 

Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -