jquery-related-selects icon indicating copy to clipboard operation
jquery-related-selects copied to clipboard

jquery.relatedselects.js is broken

Open mtcronin99 opened this issue 13 years ago • 1 comments

In release 1.1, the following code in jquery.relatedselects.js is different from jquery.relatedselects.min.js and does not work.

    // make array of select names
    $.each(opts.selects, function(){
        selects.push(key);
    });

jquery.relatedselects.min.js uses

    for (key in opts.selects)
       selects.push(key); 

In the first form, the value of key is never defined.

-MikeC

mtcronin99 avatar May 11 '11 21:05 mtcronin99

It took me a while to figure out but there is actually a rewritten version: https://github.com/ehynds/jquery-related-selects/tree/rewrite

It's working, but the options are different:

$form.relatedSelects({
    select_id: {
        source: http://mydomain.com/ajax/load/new,
        depends: 'parent_select_id'
    }
});

Also I fixed a few things that are not still updated in main repository. If you want the fixes see: https://github.com/antitoxic/jquery-related-selects/tree/rewrite

antitoxic avatar May 12 '11 11:05 antitoxic