I am using Hierarchical Select for a create-your-own-product application where the user selects 5 dependant product attributes to 'create' their products and add them to the dropbox. HS works great.

I also need to display on the page different images and different texts as the user clicks on items in the 5 select boxes (and before they add to the dropbox).

Could someone tell me what approach I should take to do this? I read the API but am no Javascript/jQuery expert.

How do I access the current selections? I need them in order to determine the unique image and texts that correspond to them.

What HS event should I focus on to put my calls to display the image and the texts?

Any help on this, esp. code snippets, would be greatly appreciated.

Comments

jlaaker’s picture

This solves easily with jQuery. You could use this as a start:

$(document).ready(function(){
    $(this).click(function () {
        $("#listbox").empty();            //empty the listbox first
        $(this).appendTo($("#listbox"));  //then add the item you have clicked
    });
});

But you need to think how to deal with the images and text...