javascript - 2 Select boxes filter -


i have read tutorial selectbox filter: http://www.cssnewbie.com/intelligent-select-box-filtering/#.uewddo30fgg http://www.lessanvaezi.com/filter-select-list-options/ selecting options , filter values in select box jquery

some of example big, have 2 selectboxes, in first selectbox have 3 entrys, how can @ easiest method filter second selectbox, have tried this:

        function cascadeselect(parent, child){         var childoptions = child.find('option:not(.static)');         child.data('options',childoptions);          parent.change(function(){                 childoptions.remove();                 child                 .append(child.data('options').filter('.sub_' + this.value))                 .change();         });          childoptions.not('.static, .sub_' + parent.val()).remove();      }      var $j = jquery.noconflict();      //$j(document).ready(function(){         cascadeform = $j('.cascadetest');         orgselect = cascadeform.find('.orgselect');         terrselect = cascadeform.find('.terrselect');         cascadeselect(orgselect, terrselect);     //}); 

that's work me if call file via "file" protocol, not http...


Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

c# - must be a non-abstract type with a public parameterless constructor in redis -

ajax - PHP/JSON Login script (Twitter style) not setting sessions -