jQuery Plugin - multiple instances with different options

jQuery Plugin - multiple instances with different options

I'm somewhat new to jQuery and writing jQuery plugins, but I'm trying to find a way to be able to have separate instances of a jQuery plugin with different options specified.

So far, the tutorials I've come across can allow multiple instances, but the options don't appear to be independent (or don't mention this outright)


So, I put together this little test, which seems to work. Each button sets its corresponding textbox's value to the name of a color without any odd behavior.

http://forceflow.50webs.com/timepickerP ... t/test.htm


However, the actual plugin I'm working on does not function like this.

http://forceflow.50webs.com/timepickerP ... ntest.html

In this plugin, you'll notice that there are 3 buttons to activate the timepicker. You're supposed to be able to click a button, select a time, and the selected time will be stored in a corresponding hidden input as well as displayed within a corresponding div (or an input element if you set it up that way).

The problem is that when a time is selected, the selected time is displayed in all the divs and stored in all the hidden inputs, rather than just the ones that correspond to each other.


Any Ideas? I'm stumped.


Thanks