This is a little baffling to me. I can get the selected value (val
attribute) on an option element, but only by using the following
method:
var selectedId = $(#mySelectElement :selected).val();
This is great, but all the examples I have read simply do the
following:
var selectedId =
On Wed, Jan 20, 2010 at 12:34 AM, Mateo matthew.kim...@gmail.com wrote:
var selectedId = $(#mySelectElement).val();
Returns the value of the select element but you want the value of the
selected option element under the select, hence:
var selectedId = $(#mySelectElement :selected).val();
Hi,
I am trying to create my first jQuery script. I want to have a text in
a p, select it with the cursor and add a class to it. I know that I
can use the .select and .addClass functions.
$(p).live(mouseup,
function() {
selection = getSelectedText();
On Mon, Jan 18, 2010 at 6:02 AM, Mircea i...@amsterdamsat.com wrote:
I am trying to create my first jQuery script. I want to have a text in
a p, select it with the cursor and add a class to it. I know that I
can use the .select and .addClass functions.
I bet you need to wrap the selected text
Hi all,
I wonder if anyone can help. I have this bit of code that selects all
the items in a multiselect list box when the form is submitted.
$('#assignUsersForm').submit(function() {
$('#assignedUserList option').each(function(i) {
I have a select where a user selects a font (style) and it is applied to
text on the page. What I am after is if there is a way via plugin etc where
the dropdown will have the style applied to each row. I am after something
like a font menu in MS Word buy using web fonts.
Any suggestions?
somehow.
Thanks
Steffan
From: Steffan Cline stef...@hldns.com
Reply-To: jquery-en@googlegroups.com
Date: Sat, 02 Jan 2010 14:07:36 -0700
To: jquery-en@googlegroups.com jquery-en@googlegroups.com
Subject: [jQuery] Select with different fonts for each element
I have a select where a user
$(select[name='kitten3']).append(new Option(group_array[i],id_array
[i]));
this code works fine in firefox but not ie
I get new node added to the select but they are blank, no value
attribute or text in the display
it's not a problem with the arrays as I have alerted them out fine in
ie
Help
http://jqueryui.com/demos/selectable/
simusch wrote:
hi
i have a small problem with jquery.
under
http://inview.ch/files/calendar.php
i created a small calendar, which is thought for booking a holidays-
house.
i'd like to do 2 things:
- click on a day changes it to yellow (works fine
I've looked around on this list and in a number of books, but nothing
I read helped me figure out how to dump out the content of nodes in a
JQuery select list. I came up with my own technique, which uses good
old fashioned DOM functions to figure out a node’s name and
attributes
hi
i have a small problem with jquery.
under
http://inview.ch/files/calendar.php
i created a small calendar, which is thought for booking a holidays-
house.
i'd like to do 2 things:
- click on a day changes it to yellow (works fine with toggleClass)
- clicking on a day and then moving the
All,
I have placed the tabs widget on my page, however, I don't want the
first tab to be the default. I want the third tab to the default
opened tab. How do I change the default?
Thanks
I have a table with 2 columns and four rows. I am currently able to
highlight the row which contains a specific piece of text. But what I
want to do is to highlight the rows that DO NOT have that piece of
text. Here's the code:
This line highlights the row that contains a cell with the text
I published this plugin sometimes back.
Its main purpose is to provide a solution to style select boxes as
needed. This is impossible with pure HTML and CSS. Also though FireFox
working with the transparencies IE doesnt do it well. And on IE 6 the
selectbox appears on top of each z-indexs.
By
I have a table that contains a select element like so
trtdkey value in hidden input/tdtdselectoptions/select/
td/tr
I need to set
$(selectclass).change(function() {
//Find the value of hidden input in 1st cell of row of the select
list that was changed.
});
So when a user changes the option
Hi,
I have a form and want to select a text input element _in that
specific form_. This is my code:
$(form [name= +formName + ] :text[name= +textInputField+ ]))
formName: a form in my document
textInputField: a input type=text in my document
If I do this
alert($(form [name= +formName + ]
Hello.
I have a list:
a href=# id=AA/a
div id=TB_ajaxContent
/div
li class=keyword_type_Ctag
/li
li class=keyword_type_Ttag
/li
li class=keyword_type_Ptag
/li
li class=keyword_type_Ltag
/li
li class=keyword_type_Ktag
/li
li class=keyword_type_Stag
/li
li class=keyword_type_Stag
/li
li
Is there a way (selector) that would allow me to select an element by
exact mach of containing text.
example:
div
This is some text
/div
div
This
/div
Lets say i want to select only the second div
$(div:contains('This'))...
okay, it would select it, but...it would also select the
/div^M
^M
div id=ui-datepicker-div class=ui-datepicker ui-widget ui-widget-content
ui-helper-clearfix ui-corner-all ui-helper-hidden-accessible
/div/body/html
--
View this message in context:
http://www.nabble.com/how-to-get-at--jquery-elements-when-i%27m-looping-through-a-jquery
--
View this message in context:
http://www.nabble.com/how-to-get-at--jquery-elements-when-i%27m-looping-through-a-jquery-select-list-with-%27each%27-tp25716736s27240p25716744.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.
buildlackey ha scritto:
$(div.disabled label).each (
function() {
alert(got a label + this);
alert(got a label + this.html()); // THIS FAILS.
});
Inside each this rappresents the html object and not a jquery or
javascript (not
hi,
i have a group of check boxes, and i want to iterator over all the
checked ones. i use the following code, but without luck.
$(input[type=checkbox][checked=true]).each(function()...);
can someone give a better solution?
--
Best Regards,
David Shen
http://twitter.com/davidshen84/
According to MSDN documentation, the change event from select
elements doesn't bubble, and that claim is borne out by my own
empirical observations. Is there some trick I can pull so that I can
handle those events from a container element via jQuery?
--
Turtle, turtle, on the ground,
Pink and
Hello!
Given the following DOM
div
span class=myClass/span
div class=notClass
span class=myClass/span
/div
/div
How can I *efficiently* find all .myClass nodes that are *NOT*
descendants of .notClass ?
What I currently do is find all .myClass nodes and then run a filter
on the
Well its for a chat box and I want to remove old messages as new
messages come in, so that there are 20 messages being shown at any one
time, using = works perfectly if you add 1 new message because it
selects the last message ID and subtracts 20, but if you add 2
messages then the first message
Then use indexes from the parent and :lt (
http://docs.jquery.com/Selectors/lt#index)
aquaone
On Tue, Sep 1, 2009 at 04:07, Namir namiras...@hotmail.com wrote:
Well its for a chat box and I want to remove old messages as new
messages come in, so that there are 20 messages being shown at any
I tried using this $(span.message[id=+old_messages+]:lt(100)).hide
(slide, {direction: up}, 2000); but it doesnt seem to be working
correctly
On Sep 1, 7:07 pm, aquaone aqua...@gmail.com wrote:
Then use indexes from the parent and :lt
(http://docs.jquery.com/Selectors/lt#index)
aquaone
wouldnt work, even if I set the index to count the number of messages
and subtract 20 and index those as sometimes there may be missing ID's
as they may have been deleted.
On Sep 1, 9:59 pm, James james.gp@gmail.com wrote:
Try using just:
$(span.message:lt(100))
If you want to remove
It doesn't matter if they're missing IDs. You don't need the IDs.
(Also, IDs cannot begin with a number. It's not valid.)
All you need to know is how many new messages you received on your
latest update (to determine how many old ones to remove), and your
maximum number of messages to display at
Try using just:
$(span.message:lt(100))
If you want to remove elements that are on the bottom, you may want to
use gt() instead of lt().
For example, suppose your code looks like:
span class=message id=msg5test/span // index 0
span class=message id=msg4test/span // index 1
span class=message
Thats a very smart way of doing it. Thanks a lot. Also why is it
invalid to start an ID as a number? I'm not receiving any errors by
doing it. Should I instead set a custom attribute called msg_id and
use that?
On Sep 1, 10:21 pm, James james.gp@gmail.com wrote:
It doesn't matter if they're
*http://www.w3.org/TR/html4/types.html#type-id
ID* and *NAME* tokens must begin with a letter ([A-Za-z]) and may be
followed by any number of letters, digits ([0-9]), hyphens (-),
underscores (_), colons (:), and periods (.).
On Tue, Sep 1, 2009 at 14:44, Namir namiras...@hotmail.com wrote:
, August 31, 2009 2:33 PM
To: jQuery (English)
Subject: [jQuery] Re: jQuery select where attribute ID less than
Still how would I do it with an each? I'd still need to select all the
ones with an attribute of less than x, and it would be stupid to loop
it from 1 to whatever as x can reach
How can I do a less than in a select e.g. something like $.(span.class
[id+ a_custom_variable +]) when I tried that it just selected all
span of class with an ID attribute rather than where ID attribute is
less than
id will be a string. AFAIK there's no built-in to parse it as a number and
compare. you'd either have to .each() it or find another means of
accomplishing what you are trying to do.
aquaone
On Mon, Aug 31, 2009 at 13:50, Namir namiras...@hotmail.com wrote:
How can I do a less than in a
Still how would I do it with an each? I'd still need to select all the
ones with an attribute of less than x, and it would be stupid to loop
it from 1 to whatever as x can reach thousands. Do you have any other
suggestions as to how I could do this?
On Aug 31, 9:58 pm, aquaone aqua...@gmail.com
(English)
Subject: [jQuery] Re: jQuery select where attribute ID less than
Still how would I do it with an each? I'd still need to select all the
ones with an attribute of less than x, and it would be stupid to loop
it from 1 to whatever as x can reach thousands. Do you have any other
suggestions
...@googlegroups.com] On
Behalf Of Namir
Sent: Monday, August 31, 2009 2:33 PM
To: jQuery (English)
Subject: [jQuery] Re: jQuery select where attribute ID less than
Still how would I do it with an each? I'd still need to select all the
ones with an attribute of less than x, and it would be stupid to loop
Can you give us a hint what your DOM elements look like? For example, are
these ID attributes in ascending order in the DOM? That would allow you to
use a very fast binary search. If they are in an undetermined order then
you're pretty much stuck with looping through them - but with thousands of
Hi,
How would I select all spans which have a span as a parent?
Thanks!
This might have been resolved, but I can't find a solution with my
search. I'm trying to add a class with the text of the option. Simple
to do the selected option, but not all of them it seems.
I want to change:
select class=required id=custom1 name=custom1
option selected= value=/
option
Hi all,
I have my website getting a value as a result of an ajax call. After
that, I would like to insert that result (a string) into a tag.
However, I would like to insert that result in a way that (1) it must
have opacity = 0, then (2) it will slideDown() so the whole content
list being pushed
How do I retrieve the currently selected option string in a select box
instead of the value?
select id=choices
option value=valueString/option
/select
Using
$(#choices).val();
returns the value if it's set. if there is no value set, jQuery
returns the string instead. I want to retrieve the
I am trying to implement a div containing an advanced search form drop
down on hover and I have everything working (only in FF) except for
when I try to add any sort of animation or speed to the '.show' or
'.hide' effect. When I try to add speed or seemingly any other effect
to the div, the
Hey All,
I have to select all my grandchildren of parent div. only the
grandchildren not either of children or great grandchildren.
div id=parent class=parent
div id=child class=child
div id=grand_child_1 class=grandchild /div
div id=great_grand_child_1
Trying to get the draggable ui working with a multiple select field,
but doesn't work.
Does it actually work with option fields ?
$(select option).draggable();
it adds the ui-draggable class to the options fields, but they are not
draggable :(
When using a select combo box that has multiple selections enabled, my
server was not seeing it as an array. It was only seeing it as a
single variable value. All I did to correct this was add [] and the
end of the name attribute.
Ex.
[code]select name=categories[] id=categories
This is the code I am using to test this. In FF and Op. When I click
on an option in the select box, the alert pops up. In IE and Chrome,
it doesn't seem to catch it at all.
$('.clickopt').mousedown(function(){
alert(test);
});
Thats it.
How can I wrap text inside a select box? or perhaps I could allow the
select box to flow over the div its in. That might actually be better
now that I think of it :)
I am using the periodic updater plug-in to make an Ajax call to grab
an HTML file that has many divs in it. I want to parse the returned
HTML and display a random div in a placeholder div on the page. I am
stuck on how to select out the random div from the returned HTML. Can
someone please lend a
is there a way to select all values of a multiple select list by
default?
This works perfectly in Firefox and Safari but in both IE 6 and 7 I
cannot get my includes to display... any suggestions? I have not found
any better solutions to accomplish using a drop down menu to display
an html message.
script type=text/javascript
var message = new Array();
I have a very long form full of items that the user rates from 1 to 3.
There may be 100 items that the user needs to rate. For each item to
rate they are given three radio buttons for 1, 2 or 3 for them to
choose from. Now initially all the radio buttons are unchecked, but
each item to rate is
Given the following structure:
div id=section_list
ul
li/li
li
ul
li/li
/ul
/li
li
ul
Hi ,
I'm just trying jQuery out for the first time...
Is this a bug in jQuery or am I doing something wrong?
I am trying to chain together a bunch of drop down select boxes.
Whenever I just use .hide() and .show() it works fine. But if I
use .show(slow) it adds big gaps between some of the
within a function for an onchange-handler ($(...).change(function(e)
{...) i tried something like:
$(:parent input[name^=subsequentProperty], this);
this does not work, but:
$(input[name^=subsequentProperty], this.parentNode);
does work.
what am i doing wrong? why doesnt the first example
Hi Guys ,
I am using the niceforms.js to change the look of the fields.
but came to know that the onchange event for select boxes in such a
form doesn't work, as the niceforms.js replaces the select box with divs
Any one have any solution, how to implement the onchange event in such
a
Hi folks, I hope you can help me out, I have a bit of html that looks
something like:
div
--h1
--h2
--p
--p
--h2
--ul
--h2
--p
And am trying to figure out a way to grab from that code each h2 and
its siblings, up-to-but-stopping-at the next h2, for example, I want
to grab from the simplified
$('a[class*=myclass]') selects all a elements whose class attribute
contains 'myclass', how do I do the opposite?
hello someone know if you have any library or tutorial ...
create a menu on the ...
http://img4.imageshack.us/img4/1235/categoriak.jpg
Dear Jquery guru's,
Not too long ago I started using jquery, it's working faily well but
I'm not exactly an expert yet to say the least.
At the moment I'm trying to create a way to select multiple options
from a large list. I did this in the following way here:
Hi everyone,
I'm getting in trouble with this problem,
I have several divs which contains an image, and another div. we can
imagine somethin like that :
div class=container
div class=img...my image.../div
div class=deletedelete/div
/div
What I want to do is, when I put the
hello everybody,
i'm new in jquery (and javascript).
ive try to write a little function to change the background-color for
an element.
it can change the text but not the background-color.
any help?
---jQuery---
$(select).change(function() {
var bar
Hi everyone,
I'm getting in trouble with Jquery selectors.
I explain my problem :
I have a select box from a form like this :
select
option opt1/option
option opt2/option
option opt3/option
/select
And i want to produce an effect on it when I the mouse hover.
I'm using the qtip
I swear I've seen a post asking this before, one that I even
participated in, but damned if i can find it
given this table structure
table
thead
tr
thOne/th
thTwo/th
thThree/th
/tr
/thead
tbody
tr
tdR1C1 Data/td
The link of this exercise is below
http://www.livrojquery.com.br/cap_10/arquivo-10.5c.html
I'm having problems selecting items Seg. e Dom.
Do not select. Dom. use because it contains the function case
sensitive. Seg. e Dom. is different from. Dom.
What is another selection to
Sounds simple but I cannot get it to work. Here is the structure.
ul class=list
lia href=#Abc/a/li
lia href=#Abc/a
ul
lia href=#Abc/a/li
lia href=#Abc/a/li
lia href=#123/a/li
/ul
/li
lia href=#Abc/a/li
lia href=#Abc/a/li
/ul
I want to get the last a in the
Hello everyone,
I've been desperately googling for a jQuery plugin that would make me
able to display thumbnails that can be selectable, like does the html
select tag (it will send photo information to a PHP script, so that
I can delete the photos). That would provide a nice, visual selection
of
how can i select all elements with a prefix of Lab
i have textboxes with ids like Lab1, Lab2, Lab3 ...
can get the download link from my blog here:
a href=http://myphpetc.blogspot.com/2009/03/jquery-select-element-
cheat-sheet.htmlhttp://myphpetc.blogspot.com/2009/03/jquery-select-
element-cheat-sheet.html/a
I need to select an element like this:
div class=class_1 class_a/div
and I've found that both of the following work:
$(.class_a).filter(.class_1).css(background-color, red);
$(.class_a.class_1).css(background-color, red);
The first one makes sense and is documented on the
I'm trying to select tables whose cells are all empty. $
(table:empty) seems to return tables with no body. $(td:empty)
finds empty cells. Can anyone help with such a selector? Thanks.
Hi
I have an autocomplete which displays list of results when i start typing.
My problem is, anytime i click to select an option the selected doesnt
settle back
in the textbox as a chosen option.
Simply put the when i select an option nothing happens. Ideally i would like
my
selected option to
Hi everyone. I'm fairly new to jquery and I am kinda perplexed with
this issue.
I've got a page (dashboard.php) with 2 select boxes. The first select
box triggers the jquery script below, which populates the 2nd box with
values:
///
script type=text/javascript
This line worked for jquery 1.2.6:
$('l...@class^=classname]')
This doesn't work for version 1.3.2
Is there some other syntax that works?
Hello,
I am looking for a Select Box replacement so I can style an HTML
Select.
I need something that works across browsers.
Something like this is very common on other frameworks but I haven't
found anything for JQuery.
Could someone, please, suggest me one?
Thanks,
Miguel
Hello,
I have a jquery object (form) and I would like to select a select
form element inside of it.
This code will work as expected:
$('#rating select')[0].selectedIndex = 2;
It will set the selectedIndex inside #rating id to select field.
var form is basically #rating and I want to do the
I am trying to make chained select. I have three selects: type,
category, product. I created ajax response conected to change of type
or category. When I change type select (list types is static, taking
from base by php), ajax give mi the list of category. It works. But
after this, when I want to
Hello all. I have the following...
div
input type=text value=1 /
/div
div
input type=text value=2 /
/div
div
input type=text value=3 /
/div
... and I want to select the second div because its child input has a
value of 2.
I know I could select the input then come back
I have a set of text box inputs in a div, and want to color the empty
ones red (css) when a user attempts to submit incomplete fields. I've
tried this with and without an explicit iterator, as shown in the two
examples below.
(a)
$(#%= this.pnlInputFields.ClientID % input[class='inputFields']
I am looking for a jquery plugin which allows me to select an image
for display. I want something similar as MSN messenger provides for
selecting display image. When I click browse button an image gallery
open up in a popup which should display uploaded images with proper
directory structure. I
current we have the html like following and I always want get element:
span xmlns=asa started from the element input:
span xmlns=asa
span
p
input value= size=10 class=exercise-input exercise-input-
formula name=1/
/p
/span
/span
or
span xmlns=asa
span/span
span
p
I have a page with alternating sets of one or more p and pre
paragraphs.
Given that $(this) is a p block, I want to select the next pre
block, plus the additional pre blocks, if any, that follow the first
one.
How?
Hello,
I use a light-box plugin on my website, http://www.FreeSoftwareWorkshop.com
and I need to select the links that end in .png, .jpg or .gif.
This is how I use the selector (it works only for .png):
$(function(){
$(.post a[href$=.png]).lightBox({
});
});
How can modify the above in
Hello There,
I want to dynamically add a select option to an existing select
dropdown when a new country is added. This i was able to do using:
$jQ(#country_id option[value='new']).before(option value=' +
value + '+ name + /option);
After that i want to get selected the just now appended
I am trying to validate all the controls that exist in the form. My
form code looks like:
form id=form1
input type=text id=txt1 name=txt1 /
br/
textarea name=txtArea id=txtArea cols=100 rows=4 /
br/
select id=sel1 name=sel1 style=width: 250px;
How would you select elements that have CSS background images ending
with .png? And then add a class.
Hi
How do get to select the FIRST sibling ?
The problem with this is that it fades out all the siblings.
dt
div
a href=# onclick=$(this).parent().parent().siblings().fadeTo
(1500, 0.3);Click here/a
/div
/dt
dd
/dd
Thanks
Hello,
I would to know how I can get a specific row in a table and get the
text of a specific td.
For example this table:
table border=1
tr
tdOrder/td
tdName/td
Hi,
i'm working on some bookmarklets / greasemonke scripts to
change some functionality in some websites.
i got some code like this
pre
line 1 - aa
line 2 - bb
line 3 - cc
/pre
and i need to select all lines that contains aa and cc
does anybody have an idea how to do this?
Hallo all.
I got a table like this
table class=font_quotazioni
thead
tr
th title=Data Contabile class=chars4Nome/th
/tr
/thead
tbody
tr class=midlight
tdfoo/td
/tr
tr
tdfoo/td
/tr
tr
tdfoo/td
/tr
Hi all, I am running into the following problem.
TABLE width=820PX align=center border=0 id=editableTable
TR class=rowbgon
TD colspan=1
nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;
input type=hidden
$(input[name='myselect'] option:selected).val(); is not working. It
gives undefined. Can anyone please help.
I have a simple show/hide thing I'm working on, but I can't figure out
how to have the script show ALL the hidden rows up to the next
heading.
Here's how the simplified HTML looks:
trtd class=groupheadHeading Text 1/td/tr
trtd class=groupGroup Item 1/td/tr
trtd class=groupGroup Item 2/td/tr
Hi people, i need a little help, i´m complete new in jquery and i am a
little lost... my doubt is:
how can i check/uncheck a checkbox by clicking a row like yahoo
mail ,for example.
my checks id is (for all) CheckAreaID and the value that they are
taking ar the AreaID.
Thanks and sorry for my
It's no surprise that the jQuery code is slower: you can always outperform
jQuery with a custom-tuned loop. After all, jQuery has to do everything that
your custom loop does, plus much more. For one thing, jQuery has to first
build an array of all the items and then traverse that array. Your
Ok got it and understood that the conventional javascript would be
faster than jQuery in this case. But what I have seen is that just by
pressing SHIFT+END, all the options in the listbox get selected. Is
there some way we can fire that event to select all options.
On Nov 20, 1:10 pm, Michael
Hi All,
I have been using jQuery for quite some time now. For one of my
projects, I needed to select all the options in the listbox which were
10,000+. I tried to do a comparison between using jQuery and
conventional javascript and here are my findings:
1. With jQuery:
Code:
I've a html page like this:
div class=chess-board
div id=casa style=position: absolute; top: 172px; left: 43px;
value=b4/
div id=casa style=position: absolute; top: 172px; left: 86px;
value=c4/
div id=casa style=position: absolute; top: 172px; left: 129px;
value=d4/
div id=casa
I have some image on webpage:
img class=imagefield height=310 width=310 title= alt= src=/
sites/default/files/first.gif/
img class=imagefield height=310 width=310 title= alt= src=/
sites/default/files/second.gif/
img class=imagefield height=310 width=310 title= alt= src=/
1 - 100 of 181 matches
Mail list logo