JQuery :: Passing A Variable Through An Attribute Filter?
Nov 3, 2009
This is my very first post! so please be kind Ok, i am very novice to jQuery. But what i am trying to do is use the jQuery attribute selector to select an input with a specific name. I can select an input of name type fine by doing the folowing:
[Code]...
View 2 Replies
ADVERTISEMENT
Dec 17, 2010
I am new to jQuery. How can I select all the elements with a given number and which has 0 has value and set to a specified value.
[Code]...
View 3 Replies
View Related
Sep 29, 2009
I am trying to do something that seems very simple, but can not get to work! Basically, I want to find an element whose ID equals a certain value, as represented by a variable. The variable is derived from a dropdown list. Here is my code:
$(document).ready(function(){
$("select").change(function() {
var myClr = $("select").val();[code]....
I am wondering if it is legal to use a variable within the filter - if I replace it with an actual ID value it works fine, but when I
substitute the variable name nothing happens.I am sure I am doing something dumb.
View 2 Replies
View Related
Aug 23, 2010
Given the following HTML:
<ul>
<li class="">1</li>
<li>2</li>
<li>3</li>
[Code].....
Unfortunately that doesn't work. I understand that the index() isdocumentation (though confusing) correctly tells you that the above code doesn't work. Maybe I'm just weird, but I feel that the way .index() is implemented for string arguments is very counter intuitive. I have an expectation that .index() is similar to indexOf() in javascript.
View 2 Replies
View Related
Aug 3, 2010
How can I get the href attribute in a variable?
View 1 Replies
View Related
May 8, 2009
but having fun with it. Would like tolearn how to do the following...2) Find the parent <li>.3) Grab the value of the attribute "jcarouselindex" and put it in avariable to be used elsewhere.Sample code below...
<ul id="carousel">
<li class="carousel-item" jcarouselindex="1">
<a href="/someurl"><img src="someimage.jpg" alt="" />
[code]....
View 1 Replies
View Related
Dec 15, 2009
Here's what I hope to be a quick question that I should be able to figure out myself... but, unfortunately, I can't...I'm trying to pass a variable into the attribute selector. When I substitute the "+myHref+" for "http", I get a match. When I log the myHref var, I get a match. What's wrong with my syntax? Why isn't the myLink finding a match?
[Code]...
View 3 Replies
View Related
Oct 5, 2010
I try to load specific text from a page into a string. When I'm on the specific page I can do this as follows: var wantedText = $("td > span[style='color: #00AA00; font-weight: bold;']").text();But I want to get this text from another webpage using AJAX, I tried using .load() as follows:
$('#somediv').load(Url+" td > span"); //this loads 3 spans into #somediv (including the one I need)
$('#somediv').load(Url+" td > span[style='color: #00AA00; font-weight: bold;']"); //this does nothing
I also tried loading the entire page into a string using .ajax() like this:
[Code]....
View 3 Replies
View Related
Aug 12, 2011
Code:I am having problems with the following. I am wanting to hide <tr> in my table (employees) and only show employees that are in the selected department (selected via dropdown box).I need to set a javascript array to a php array. I am looping and assigning the array and am wanting to pass a javascript variable as the index in php array. I have marked my problem lines in red. Thanx for any help.
<script type="text/javascript" >
function display_elements()
{
var departments = new Array;
[code]....
View 1 Replies
View Related
Mar 29, 2011
<script>$(document).ready(function(){
$('td img').click(function(){
alert($(this).attr('id'));
});
$.ajax({
[Code]...
I am new to jquery and I was wondering on how to send the id of the image I clicked on to a ajax call.
View 2 Replies
View Related
Dec 3, 2010
function findDivs(id)
{
$('div[id~="' + id + ''"]').innerHTML = "insert this text into div's with id that contains the variable: id";
}
So the selector i am using isn't working. I'm pretty new to jQuery so the selector may be completely off.
View 1 Replies
View Related
Sep 16, 2010
I want to pass a variable between dialogue boxes but can't get it to work:
<script type="text/javascript">
function deleteE(v,m,f){
if(v == true) {
$.prompt('Enquiery Deleted.',{callback: del, buttons: {OK: true}, persistent: true}) ;
[Code].....
I have got the process for removing the record from the database to work fine, it's just getting this value from the first box to the last and into the php file.
View 2 Replies
View Related
Apr 17, 2011
I'm having a tough time trying to add the "zip" variable to my YQL statement.
var zip = $(this).attr('zip');
$.YQL("select * from rss where url='http://weather.yahooapis.com/forecastrss?p=' ' "+ zip +" ' ", function(data){
var w=data.query.results.item;
[Code].....
I've tried as many different ways as I could imagine. Simply putting the literal zip code in the query works perfect.
View 2 Replies
View Related
Aug 15, 2010
if this is such a obvious question, but i'm kind of newbie in JQuery, i am using a lightpop plugin, & i want to pass 'image_path' via html. lightpop plugin code is something like this:
(function(jQuery){
jQuery.browser = jQuery.extend(
{chrome: /chrome/i.test(navigator.userAgent)} ,
jQuery.browser
[Code]...
View 1 Replies
View Related
May 27, 2011
I have a set of select form elements. What I want it to do is this.
when I select 'tiger', then I want it to trigger and update the div 'description.'
How would I go about doing this.. I am relatively new to jQuery.
View 6 Replies
View Related
Jul 20, 2011
Basically I want the field name to be a variable but it is taking it as a literal.When I print back the POST array with PHP I get:- Array ( [field_name] => Whatever I typed )So if the text field has a name of 'username' then I want the PHP to print back
Array ( [username] => Whatever I typed )
$(function(){//on DOM.load
$('.register-field').blur(function() {
var field_val = $(this).val();
[code]....
View 1 Replies
View Related
Dec 31, 2011
I'm trying to pass a var via object to .load() ... .load(URL, {"myname":var}, function) { ... This will not work unless the var is in quotes and therefore not a variable anymore. I want to be able to use a form to feed data to the program that loads the data.
View 8 Replies
View Related
Aug 11, 2009
I've used jquery to create a tabbing system and I want to be able to use it on multiple pages. I want to be able to pass a variable containing the number of items in the list from the html to the js file. Inside the js file I have this function:
[Code]...
View 2 Replies
View Related
Oct 11, 2010
I've looked extensively for the answer to this but suspect my inexperience means I'm using the wrong "keywords" in searches, or the answer involves jquery beyond my comprehension.
I have script experience and have plug-in galleryView working but have no jQuery experience which is the problem.
The script:
<script type="text/javascript">
name
= getValue("name");
$(document).ready(function(){
[Code]....
Variable name contains data stripped from the page URL (www.url.com?name=3). I want to use this variable in the jquery array/list passed into the galleryView instead of the number 3. How can this be achieved? I suspect this could be done entirely in jquery (if I had the experience) or via the getdata script used above?
View 6 Replies
View Related
Sep 26, 2011
I am trying to pass a variable from gsp to jquery. But I have a problam.I have variable a which contains 635 element. like this a = [2,555,43,32,43,........]Here I am grabing this value fromgsp to jquery..
<html>
<head>
<script>
[code]....
View 5 Replies
View Related
Oct 5, 2011
I have this image gallery in which clients should be able to determine the order in which their images are shown. The sortable part works. Then I want to pass the new order to the next page called act_writeneworder.cfm (i am using coldfusion)
I just started with jQuery and it is driving me nuts:-) Each time I think I am having it well i am testing and the variable passed through gives an empty string.
My code:
<script type="text/javascript">
$(function() {
$( "#ulsortable" ).sortable();
});
[Code]......
View 2 Replies
View Related
Nov 14, 2011
I'm having issues while passing the triggered event with .on.
obj.on('click', feedmania.handler.itemFeedmania.toggleFormComment);
I've tried:
obj.on('click', feedmania.handler.itemFeedmania.toggleFormComment(e));
obj.on('click', function(e){feedmania.handler.itemFeedmania.toggleFormComment(e)});
[Code]...
View 1 Replies
View Related
Mar 20, 2011
what i want to do-
$
(
"#temp"
).
[Code]....
View 1 Replies
View Related
Oct 23, 2010
I can't seem to get a variable declared from within a post callback, so that I could manipulate my script accordingly. I have delete.php, that deletes an id from a mysql db. If it fails, I want the script to stop and display the error. The .php script echos an "ok" if everything went fine, if not - it echos the error.var abort_error; // set the error variable
$.get("delete.php", { delete: $(this).parent().parent().parent().attr('id') },
function(data){
if(data != 'ok') {
[code]...
View 1 Replies
View Related
Jun 30, 2010
I've made a made a lovely form which is loaded into a dialog upon clicking a link. Works fine, but I want something which identifies they URL clicked on initially (e.g. /stats.php?id=bob ) to end up as a hidden form field. Should be easy but I can't get the syntax/logic right.
[Code]...
View 2 Replies
View Related
Jul 13, 2011
I'm passing a variable to a selector. I have found a few resources and tried to implement them but they're just not working for me. I am trying to find href that match my variable and am working with the following:
var itemLink = /site/Mario-Kart..etc.
$("a[href=" + itemLink + "]").......etc.
I receive an error "Uncaught Syntax Error unrecognized expression: [href=/site/Mario-Kart..etc. ]" I have been placing the quotes in different places to correct the syntax but to no avail. Also, this works with JQuery v1.44 and earlier but not after.
View 4 Replies
View Related