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
Comment #1
wim leersYou can do this using JS, by hooking into the events that are triggered by HS. You can find all documentation in API.txt.
If you don't know enough JS, well, then this is another incentive to learn it. :)
Comment #2
jpdaut commentedI am learning. I was hoping that perhaps you could tell me which event would be most appropriate for this case. I suppose it is the
before-update-hierarchical-select
but am not sure. Is that event raised on every selection click?
Or should it be the before-add-to-dropbox event? I'm not clear on these events.
Also how are hsid's enumerated for different elements and items?
Thanks for your help.
Comment #3
wim leersProbably before-update-hierarchical-select, yes.
The first HS has hsid 0, the second 1, etc.