[jQuery] Re: Select option value not working

2008-12-09 Thread Karl Rudd

The SELECT's value is what you want:

$(input[name='myselect']).val()

The only time you need to check is individual OPTIONs are selected is
if you have a multi-select list box.

Karl Rudd

On Tue, Dec 9, 2008 at 8:09 PM, JQueryProgrammer
[EMAIL PROTECTED] wrote:

 $(input[name='myselect'] option:selected).val(); is not working. It
 gives undefined. Can anyone please help.


[jQuery] Re: Select option value not working

2008-12-09 Thread James Hughes

$('input[value=GO]').click(function(){});
 



From: jquery-en@googlegroups.com on behalf of JQueryProgrammer
Sent: Tue 09/12/2008 10:32
To: jQuery (English)
Subject: [jQuery] Re: Select option value not working




Great. Thanks. lso is it possible to select an element based on the
value it has.

I have an button like input type=button value=GO /

I want to attach an event to this button. How can I..?

On Dec 9, 3:16 pm, Karl Rudd [EMAIL PROTECTED] wrote:
 Heh yeah that too. :) Sorry I missed that detail.

 Karl Rudd

 On Tue, Dec 9, 2008 at 9:08 PM, Rik Lomas [EMAIL PROTECTED] wrote:

  It could be to do with the select isn't an input tag, it's a select
  tag, try $(select[name='myselect'] option:selected).val(); instead

  Rik

  2008/12/9 Karl Rudd [EMAIL PROTECTED]:

  The SELECT's value is what you want:

 $(input[name='myselect']).val()

  The only time you need to check is individual OPTIONs are selected is
  if you have a multi-select list box.

  Karl Rudd

  On Tue, Dec 9, 2008 at 8:09 PM, JQueryProgrammer
  [EMAIL PROTECTED] wrote:

  $(input[name='myselect'] option:selected).val(); is not working. It
  gives undefined. Can anyone please help.

  --
  Rik Lomas
 http://rikrikrik.com http://rikrikrik.com/ 




This e-mail is intended solely for the addressee and is strictly confidential; 
if you are not the addressee please destroy the message and all copies. Any 
opinion or information contained in this email or its attachments that does not 
relate to the business of Kainos 
is personal to the sender and is not given by or endorsed by Kainos. Kainos is 
the trading name of Kainos Software Limited, registered in Northern Ireland 
under company number: NI19370, having its registered offices at: Kainos House, 
4-6 Upper Crescent, Belfast, BT7 1NT, 
Northern Ireland. Registered in the UK for VAT under number: 454598802 and 
registered in Ireland for VAT under number: 9950340E. This email has been 
scanned for all known viruses by MessageLabs but is not guaranteed to be virus 
free; further terms and conditions may be 
found on our website - www.kainos.com 




[jQuery] Re: Select option value not working

2008-12-09 Thread James Hughes

or more specificly, i think,  $(':button[value=GO]').click(...



From: jquery-en@googlegroups.com on behalf of JQueryProgrammer
Sent: Tue 09/12/2008 10:32
To: jQuery (English)
Subject: [jQuery] Re: Select option value not working




Great. Thanks. lso is it possible to select an element based on the
value it has.

I have an button like input type=button value=GO /

I want to attach an event to this button. How can I..?

On Dec 9, 3:16 pm, Karl Rudd [EMAIL PROTECTED] wrote:
 Heh yeah that too. :) Sorry I missed that detail.

 Karl Rudd

 On Tue, Dec 9, 2008 at 9:08 PM, Rik Lomas [EMAIL PROTECTED] wrote:

  It could be to do with the select isn't an input tag, it's a select
  tag, try $(select[name='myselect'] option:selected).val(); instead

  Rik

  2008/12/9 Karl Rudd [EMAIL PROTECTED]:

  The SELECT's value is what you want:

 $(input[name='myselect']).val()

  The only time you need to check is individual OPTIONs are selected is
  if you have a multi-select list box.

  Karl Rudd

  On Tue, Dec 9, 2008 at 8:09 PM, JQueryProgrammer
  [EMAIL PROTECTED] wrote:

  $(input[name='myselect'] option:selected).val(); is not working. It
  gives undefined. Can anyone please help.

  --
  Rik Lomas
 http://rikrikrik.com http://rikrikrik.com/ 




This e-mail is intended solely for the addressee and is strictly confidential; 
if you are not the addressee please destroy the message and all copies. Any 
opinion or information contained in this email or its attachments that does not 
relate to the business of Kainos 
is personal to the sender and is not given by or endorsed by Kainos. Kainos is 
the trading name of Kainos Software Limited, registered in Northern Ireland 
under company number: NI19370, having its registered offices at: Kainos House, 
4-6 Upper Crescent, Belfast, BT7 1NT, 
Northern Ireland. Registered in the UK for VAT under number: 454598802 and 
registered in Ireland for VAT under number: 9950340E. This email has been 
scanned for all known viruses by MessageLabs but is not guaranteed to be virus 
free; further terms and conditions may be 
found on our website - www.kainos.com 




[jQuery] Re: Select option value not working

2008-12-09 Thread JQueryProgrammer

Great. Thanks. lso is it possible to select an element based on the
value it has.

I have an button like input type=button value=GO /

I want to attach an event to this button. How can I..?

On Dec 9, 3:16 pm, Karl Rudd [EMAIL PROTECTED] wrote:
 Heh yeah that too. :) Sorry I missed that detail.

 Karl Rudd

 On Tue, Dec 9, 2008 at 9:08 PM, Rik Lomas [EMAIL PROTECTED] wrote:

  It could be to do with the select isn't an input tag, it's a select
  tag, try $(select[name='myselect'] option:selected).val(); instead

  Rik

  2008/12/9 Karl Rudd [EMAIL PROTECTED]:

  The SELECT's value is what you want:

     $(input[name='myselect']).val()

  The only time you need to check is individual OPTIONs are selected is
  if you have a multi-select list box.

  Karl Rudd

  On Tue, Dec 9, 2008 at 8:09 PM, JQueryProgrammer
  [EMAIL PROTECTED] wrote:

  $(input[name='myselect'] option:selected).val(); is not working. It
  gives undefined. Can anyone please help.

  --
  Rik Lomas
 http://rikrikrik.com


[jQuery] Re: Select option value not working

2008-12-09 Thread JQueryProgrammer

Ok. I got the answer. its like

$(input[value='GO'])

BUt now my problem is that while rendering the button is rendered as:

input type=button value=GO onclick=myFunc(); /

no I want to attach my event and cancel the default event, ie. I do
not want to call the myFunc. But instead my own function that I have
attached as:

$(input[value='GO']).click(function(event) {
 event.preventDefault();
 alert(Default Event Cancelled);
});

But still its not canceling the default event.

On Dec 9, 3:32 pm, JQueryProgrammer [EMAIL PROTECTED] wrote:
 Great. Thanks. lso is it possible to select an element based on the
 value it has.

 I have an button like input type=button value=GO /

 I want to attach an event to this button. How can I..?

 On Dec 9, 3:16 pm, Karl Rudd [EMAIL PROTECTED] wrote:

  Heh yeah that too. :) Sorry I missed that detail.

  Karl Rudd

  On Tue, Dec 9, 2008 at 9:08 PM, Rik Lomas [EMAIL PROTECTED] wrote:

   It could be to do with the select isn't an input tag, it's a select
   tag, try $(select[name='myselect'] option:selected).val(); instead

   Rik

   2008/12/9 Karl Rudd [EMAIL PROTECTED]:

   The SELECT's value is what you want:

      $(input[name='myselect']).val()

   The only time you need to check is individual OPTIONs are selected is
   if you have a multi-select list box.

   Karl Rudd

   On Tue, Dec 9, 2008 at 8:09 PM, JQueryProgrammer
   [EMAIL PROTECTED] wrote:

   $(input[name='myselect'] option:selected).val(); is not working. It
   gives undefined. Can anyone please help.

   --
   Rik Lomas
  http://rikrikrik.com
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
jQuery (English) group.
To post to this group, send email to jquery-en@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/jquery-en?hl=en
-~--~~~~--~~--~--~---



[jQuery] Re: Select option value not working

2008-12-09 Thread Karl Rudd

Heh yeah that too. :) Sorry I missed that detail.

Karl Rudd

On Tue, Dec 9, 2008 at 9:08 PM, Rik Lomas [EMAIL PROTECTED] wrote:

 It could be to do with the select isn't an input tag, it's a select
 tag, try $(select[name='myselect'] option:selected).val(); instead

 Rik


 2008/12/9 Karl Rudd [EMAIL PROTECTED]:

 The SELECT's value is what you want:

$(input[name='myselect']).val()

 The only time you need to check is individual OPTIONs are selected is
 if you have a multi-select list box.

 Karl Rudd

 On Tue, Dec 9, 2008 at 8:09 PM, JQueryProgrammer
 [EMAIL PROTECTED] wrote:

 $(input[name='myselect'] option:selected).val(); is not working. It
 gives undefined. Can anyone please help.




 --
 Rik Lomas
 http://rikrikrik.com



[jQuery] Re: Select option value not working

2008-12-09 Thread Rik Lomas

It could be to do with the select isn't an input tag, it's a select
tag, try $(select[name='myselect'] option:selected).val(); instead

Rik


2008/12/9 Karl Rudd [EMAIL PROTECTED]:

 The SELECT's value is what you want:

$(input[name='myselect']).val()

 The only time you need to check is individual OPTIONs are selected is
 if you have a multi-select list box.

 Karl Rudd

 On Tue, Dec 9, 2008 at 8:09 PM, JQueryProgrammer
 [EMAIL PROTECTED] wrote:

 $(input[name='myselect'] option:selected).val(); is not working. It
 gives undefined. Can anyone please help.




-- 
Rik Lomas
http://rikrikrik.com