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.
$('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
Ok. I got the answer. its like
$("input[value='GO']")
BUt now my problem is that while rendering the button is rendered as:
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
Great. Thanks. lso is it possible to select an element based on the
value it has.
I have an button like
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,
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
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 c
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='myselec
To answer your question as far as what is _wrong_ with your code -
AFAIK, you can't mix an object reference (variable) & a text string
within a single jQuery selector parameter. You have the right idea
though. Modifying what you had just a little will work:
var spName = $("option:selected"
> This seems to be a better one:
>
> function specify(current)
> {
> alert( $j(current).children("[EMAIL PROTECTED]").val() + " " +
> $j(current).children("[EMAIL PROTECTED]").text() );}
Better in what way?
This seems to be a better one:
function specify(current)
{
alert( $j(current).children("[EMAIL PROTECTED]").val() + " " +
$j(current).children("[EMAIL PROTECTED]").text() );
}
--
View this message in context:
http://www.nabble.com/Select-option-value-tp17592925s27240p17611145.html
Sent
It's easier than you think. Just use the value of the select element itself:
function specify( select ){
var spName = select.value;
alert( spName );
}
You may want to run the same code on the keyup event as well as the change
event, to make the cursor keys select immediately:
And, of
11 matches
Mail list logo