views:

525

answers:

1

Hi,

I'm trying to implement chained filter dropdown using just javascript - jquery.

The solution I need is http://www.codeassembly.com/Simple-chained-combobox-plugin-for-jQuery.

However I can't use this solution as it depends on a PHP file. Are there ways to implement this solely using javascript (client and/or serverside)?

Many Thanks

+1  A: 

For a simple jQuery plugin that doesn't need any other datasource or data file. You can use:

http://code.google.com/p/jquery-option-tree/

All the options get defined in the JS code, hopefully you wont have a large dataset.

<input type="text" name="demo1" />

    var option_tree = {
       "Option 1": {"Suboption":200},
       "Option 2": {"Suboption 2": {"Subsub 1":201, "Subsub 2":202},
             "Suboption 3": {"Subsub 3":203, "Subsub 4":204, "Subsub 5":205}
            }
    };

    $('input[name=demo1]').optionTree(option_tree);
Glennular