Re: [jQuery] select box - options manipulation

2007-03-26 Thread MARIO MOURA

Thanks Klaus

I tested and this apparently avoid do the click in my combo.
You ask why I am looking for this. I am building an amazing and animate
triple combo like (continent-country-city).
So my solution isnt Ajax. I query my database first and manipulate this data
with JQuery.
But the problem if the user change the first or second option the combos
still selected (but hide).
I cant use empty function because if I use this my DOM will lose the data.
I am trying now install some plugins but if I could use Jquery core function
will be better.

Thank for help.

Regards

Mario



2007/3/24, Klaus Hartl [EMAIL PROTECTED]:


MARIO MOURA schrieb:
 Do you have a example?

 $(#edit-taxonomy-6).change(value,0);

 I am trying back to value=0

 Regards

 macm

Try this:

$('#edit-taxonomy-6').bind('change', function() {
 this.value = 0;
});

That will select the option that has the value 0. Although that doesn't
seem to make any sense to me. You could as well simply disable the select.


-- Klaus

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/





--
Mário Alberto Chaves Moura
[EMAIL PROTECTED]
31-9157-6000
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] select box - options manipulation

2007-03-24 Thread Klaus Hartl
MARIO MOURA schrieb:
 Do you have a example?
 
 $(#edit-taxonomy-6).change(value,0);
 
 I am trying back to value=0
 
 Regards
 
 macm

Try this:

$('#edit-taxonomy-6').bind('change', function() {
 this.value = 0;
});

That will select the option that has the value 0. Although that doesn't 
seem to make any sense to me. You could as well simply disable the select.


-- Klaus

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] select box - options manipulation

2007-03-23 Thread MARIO MOURA

Do you have a example?

$(#edit-taxonomy-6).change(value,0);

I am trying back to value=0

Regards

macm


2007/3/21, Mike Alsup [EMAIL PROTECTED]:


Aljosa,

You need to bind to the change event on the select element.


On 3/21/07, Aljosa Mohorovic [EMAIL PROTECTED] wrote:
 i have a DIV.selection tag and inside SELECT with OPTION tags.
 using jquery i can find and manipulate options with
 $('div.selection').find(option).each and similar but i can't bind
 events for option onclick events in IE7 (haven't looked IE6, firefox
 works).

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/





--
Mário Alberto Chaves Moura
[EMAIL PROTECTED]
31-9157-6000
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] select box - options manipulation

2007-03-21 Thread Mike Alsup
Aljosa,

You need to bind to the change event on the select element.


On 3/21/07, Aljosa Mohorovic [EMAIL PROTECTED] wrote:
 i have a DIV.selection tag and inside SELECT with OPTION tags.
 using jquery i can find and manipulate options with
 $('div.selection').find(option).each and similar but i can't bind
 events for option onclick events in IE7 (haven't looked IE6, firefox
 works).

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] select box - options manipulation

2007-03-21 Thread Rob Wilkerson
Options within selects don't have an onclick event.  Use the onchange
event of the select, instead, and detect the selected value.  I'm new
to jQuery, but you can't do this in straight JavaScript (unless I've
missed the memo - which is possible), so I suspect you may not be able
to do it in jQuery.

On 3/21/07, Aljosa Mohorovic [EMAIL PROTECTED] wrote:
 i have a DIV.selection tag and inside SELECT with OPTION tags.
 using jquery i can find and manipulate options with
 $('div.selection').find(option).each and similar but i can't bind
 events for option onclick events in IE7 (haven't looked IE6, firefox
 works).

 so i'm looking for a way to manipulate option tags in select box and
 catch events.
 is there any way to do this for any browser? simple examples appreciated.

 Aljosa

 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] select box - options manipulation

2007-03-21 Thread Rob Wilkerson
Even a blind squirrel finds a nut every once in a while.  :-)

On 3/21/07, Alex Cook [EMAIL PROTECTED] wrote:
 You would be correct sir :)

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
 Behalf Of Rob Wilkerson
 Sent: Wednesday, March 21, 2007 9:18 AM
 To: jQuery Discussion.
 Subject: Re: [jQuery] select box - options manipulation

 Options within selects don't have an onclick event.  Use the onchange
 event of the select, instead, and detect the selected value.  I'm new
 to jQuery, but you can't do this in straight JavaScript (unless I've
 missed the memo - which is possible), so I suspect you may not be able
 to do it in jQuery.

 On 3/21/07, Aljosa Mohorovic [EMAIL PROTECTED] wrote:
  i have a DIV.selection tag and inside SELECT with OPTION tags.
  using jquery i can find and manipulate options with
  $('div.selection').find(option).each and similar but i can't bind
  events for option onclick events in IE7 (haven't looked IE6, firefox
  works).
 
  so i'm looking for a way to manipulate option tags in select box and
  catch events.
  is there any way to do this for any browser? simple examples
 appreciated.
 
  Aljosa
 
  ___
  jQuery mailing list
  discuss@jquery.com
  http://jquery.com/discuss/
 

 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/

 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] select box - options manipulation

2007-03-21 Thread Alex Cook
You would be correct sir :)

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Rob Wilkerson
Sent: Wednesday, March 21, 2007 9:18 AM
To: jQuery Discussion.
Subject: Re: [jQuery] select box - options manipulation

Options within selects don't have an onclick event.  Use the onchange
event of the select, instead, and detect the selected value.  I'm new
to jQuery, but you can't do this in straight JavaScript (unless I've
missed the memo - which is possible), so I suspect you may not be able
to do it in jQuery.

On 3/21/07, Aljosa Mohorovic [EMAIL PROTECTED] wrote:
 i have a DIV.selection tag and inside SELECT with OPTION tags.
 using jquery i can find and manipulate options with
 $('div.selection').find(option).each and similar but i can't bind
 events for option onclick events in IE7 (haven't looked IE6, firefox
 works).

 so i'm looking for a way to manipulate option tags in select box and
 catch events.
 is there any way to do this for any browser? simple examples
appreciated.

 Aljosa

 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/