I figured it out. It was actually a bit easier than I thought (I just
needed access to my Javascript book which I had left at work):

Change the javascript function:

function dblClick(e)
{
        var item = getElement("myselector") ;
        alert("You selected: " + item.value);

}


To:

function dblClick(e)
{
      var item = getElement("myselector") ;
     // Item.value is the index into the option (because of how it was
set up).
     // to get the text we need to index the options array
     alert("You selected: " + item.options[item.value].text);
}

Thanks,

Glenn


On Mar 4, 5:35 am, Jorge Godoy <[EMAIL PROTECTED]> wrote:
> Em Tuesday 04 March 2008 07:18:29 Diez B. Roggisch escreveu:
>
> > item.value should be it, yet I only used it with "onchange" so far. Are you
> > sure "ondblclick" is emitted by select-boxes?
>
> It is.  I use that with SelectShuttle to provide an alternative way to select
> and click the arrow button.
>
> I think that he won't be able to get the text value easily, though.
>
> Printing the available methods/properties from the selected object would help
> him seeing what is available or not but I'd try the label property and if
> that doesn't work something like taking the specific item from the array of
> options available for that select (in Python it would be similar to
> select_id.items[item], but of course you're dealing with JS so there's a
> small change to that and I don't remember exactly how to do that by now).
>
> --
> Jorge Godoy      <[EMAIL PROTECTED]>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to