jquery

jQuery remote validation race condition

I'm having a problem with the jQuery validate plugin and the remote validation rule, used in combination with the jQuery form plugin. So I use the jQuery form plugin to intercept to form submition and if the validation fails, the form is not submitted. However, if the remote rule is already being validated (waiting for an answer from th...

Global onBlur/onFocus

We have, like everyone else, forms all over our web app. So far we've been using the following (or some variation) in most every form element: class="formThingy" onFocus="document.theForm.theField.className='formThingySelected';" onBlur="document.theForm.theField.className='formThingy';" It's a pain. Is there an easy way to do g...

How to dynamically fill an input text field in CakePHP using Ajax?

I have an "Add Person" form with a few fields (name, address, phone number, etc). I want to be able to pre-fill some of the fields using information from other fields BEFORE submitting the form. For example, once the user puts in a city, an Ajax query will pull the area-code for the phone number (the Controller has a "city to area code...

jQuery treat strings as variables?

I've done some work with Scriptaculous, and now I'm dipping my feet in to JQuery to see which of the two frameworks I like working with the most. I am running in to some behavior that strikes me as odd... $.ajax({ type: "POST", url: "addcart.php", data: "userID="+ userID + "&cardID=" + cardID + "&cardQTY=" + cardQTY + "&set=m...

jQuery Ajax loading content from another page of the site

I'm trying to pull the contents of Div from another page of the site I'm working on and update the Div on the current page. I want to do this so I don't need a page reload. The Ajax call I'm making works fine in Firefox, it updates the Div with the content from the other page of the site. The problem is it breaks in IE, when I try to get...

Does jQuery's show() method work on tables in IE?

I have a table with some of the rows starting off hidden (display:none) and I'm using jQuery to show them. I've gathered from Firebug that jQuery detects that they're table rows and sets them to display:table-row rather than block. However, IE6 (and I think 7, too) doesn't support table-row, so does jQuery do something different for tho...

Suppress anchor tag <a> href when using jquery

I have the following code: <script type="text/javascript"> $(document).ready(function() { $("#thang").load("http://www.yahoo.com"); $(".SmoothLink").click( function() { $("#thang").fadeOut(); $("#thang").load($(this).attr("href")); $("#thang").fadeIn(); }); }); </script> <...

UTC within Site

Hi, I am working on a website that will only be available via the intranet but is a website that is Australia wide ONLY. The thing is, I have been asked to look into making the site UTC and was wondering how I could go about displaying a clock or determing which timezone the site in running in and so perhaps display a clock on the home...

Parse JSON array with jQuery .each()

Hi All! I have this jQuery function function getData(jsonLink){ $(".scrollable .items").html("<img class='loadGif' src='/sites/all/themes/zen/journeyon/images/ajax-loader.gif' alt='' />"); $.ajaxSetup({ url: jsonLink, global: false, type: "GET" }); $.ajax({ url: jsonLink, success: function(data) { var...

how to maintain spacing between two fluid divs?

Hi, I have a parent div with two child divs (one floated left and one right) inside the parent. The web page must work on both 1024px definitions and 1620px so they need to be fluid if expanded in width. All margins look fine with the exception of the vertical space between the left and right divs. I am using jquery to maintain equal...

Why does jQuery .insertAfter not work in this example?

In the following example, the alert shows, but the #message is blank. If I comment out the .insertAfter line then the #message is displayed correctly. Why doesn't the .insertAfter work in this example? Firebug just steps right over it. javascript: google.load("jquery", "1.3.2"); //run when page is loaded google.setOnLoadCallback(f...

External JSON data with offline development

I am developing a web app that accesses some external JSON data. I'm currently using jQuery's getJSON to get the data and call the callback. My internet at home is terrible, so I'm regularly not connected. I am looking for a way to develop this app while disconnected from the internet. My initial thought was to have an OFFLINE variabl...

Ignore child elements when selecting elements in jQuery

here is my HTML: <div class="foo"> <span class="ignore_this">IGNORE THIS TEXT</span> SELECT THIS </div> I'm trying to figure out how to select all the stuff inside foo, but not the stuff inside ignore_this: $("div.foo:not(span.ignore_this)").text() but I can't figure out how. ...

getting slider value from past

i'm having a page jquey slider and page gets refreshed by on submit. how to keep the past value of a slider after refreshing too ...

jQuery tabs, separate divs for tabs and content

I'm using jquery tabs with no problems except that I would like to have separate divs for the list (tabs) and the content. <div id="tabs"> <ul> <li><a href="#articles">Articles</a></li> <li><a href="#videos">Videos</a></li> <li><a href="#photos">Photos</a></li> </ul> <div id="articles" class="bd">Lorem ipsum ...

jQuery: query a $.get() returned string

Hi, How can i query a string i get via $.get? for example, i want form google only the body html: $.get("www.google.com", function(data){ var body = $("body", data).html(); //This doesnt work }); Is it even possible? thanks ...

Slidetoggle or slideup

When use slideup/slidedown and when use slidetoggle? is slidetoggle have problem with ie? ...

How to combine jquery UI/Tabs with ImageFlow based on JavaScript

Hi I'm currently trying to embed the ImageFlow Plugin into a single Tab, which is created by the jQuery Plugin UI/Tabs. My Problem is that the ImageFlow-generated Interface is not shown correctly. I think this might be, because the div is invisible/hidden on initialisation. Is there a way to show the imageFlow inside a Tab? I tried the ...

jquery modal form

I am having an issue with a modal form. I have a text link that opens the modal form(working). Once the form opens it shows a registration page(working). The buttons used to submit the form are through the modal form. For example: $("#register-dialog").dialog({ bgiframe: true, autoOpen: false, height: 450, width: 400, modal: true, butto...

How do you use a custom framework with Objects in JQuery.

Hi, I have just started a new job out of uni and I am learn OO PHP we have a custom framework where I work and my boss was talking about teaching me how to use JQuery with objects. I am also unsure whether he means objects from PHP classes or whether JQuery has its own object of some type. I am not sure exactly what he means by this. I...