tags:

views:

32

answers:

0

Hello all,

I was thinking of using this customselect plugin here: link text for one of my projects.

I just want to retrieve the value of the element on an event - preferably a click event. The select box made by the plugin is basically just a jquery object. So, it is being assigned an "id" dynamically.

<script>
var ddlObj1=$("#testdiv").finalselect(
   {
     id:"test", zIndex:1, viewWidth:'260px', viewHeight:'150px',
     selectImage:"http://finalevillee.googlepages.com/select.png'
   });
ddlObj1.addItem('<table><tr><td style="width: 37px;">' +
        '<img src="example.gif"/></td><td><span class="thistext">' +
        'Test</span><br/></td></tr></table>','test');
</script>

So what if I want to do some action, say store the value of the select in a hidden variable? The creator of the plugin has provided an inbuilt method called "getValue()". But the example he's given there on the page works on the firing of a button element, not the actual custom select itself.

But I thought that could be done by just using the id of the customselect since the creation of the jquery object is done with the id attribute also as you can see in the code. So, I concluded that I don't know something basic about jquery. I also checked with console.log of firebug to check the events supported by that particular created element - it just gave out "undefined" - this probably also proves that I'm doing something wrong here.

I'm sorry if my question doesn't make much sense.

Thanks a lot!