jquery

jQuery: grabbing form values

If form is submitted to a function using onsubmit(), how can I get an array of the values of all checkboxes with name='values[]' ? EDIT: originally I mentioned radio buttons, this is wrong - checkboxes is correct. EDIT: line below only gets the value of the first one, obviously $("input[name='values[]']:checked").val() Also, how ca...

jQuery and UIWebView

I'm looking for a way to automatically bring up the iPod/iPhone keyboard to enter data into a form element when the page loads. I'm using jQuery. For some reason selecting the element in the document.ready() event handler and using the focus() event does not trigger the keyboard to come up. $("#myInput").click() doesn't work either. ...

jQuery tablesorter - sorting a column with mixed text and numbers

I have a table with a column of data that is mixed text and numbers. I'm sorting it using jQuery and the tablesorter plugin. The data that won't sort correctly is equipment tags, for example, "AHU-1", "AHU-2", "AHU-10". The problem is, given those example values, AHU-10 will be placed between AHU-1 and AHU-2. I've found forcing a 'digi...

Is it possible to listen to a "style change" event?

Is it possible to create an event listener in jQuery that can be bound to any style changes? For example, if I want to "do" something when an element changes dimensions, or any other changes in the style attribute I could do: $('div').bind('style', function() { console.log($(this).css('height')); }); $('div').height(100); // yields...

Enable/disable asp.net validator controls within a specific "ValidationGroup" with jQuery?

I know how to enable/disable individual validator controls on the client side using ValidatorEnable(validator, false); But how do you enable/disable all the validators within a ValidationGroup? ...

jQuery: Evaluate script in ajax response

XML responses from my webapp have both HTML to add to the page AND some have a script to run. I'm trying to send back XML from my webapp like: <?xml version="1.0"?> <doc> <html-to-insert> <![CDATA[<p>add me to the page</p>]]> </html-to-insert> <script> <![CDATA[ alert('execute me'); ]]> </script> </doc> What I'm doin...

jQuery deep linking & ajax loading in multiple containers (sub containers)

Hi! I currently developing a site and have bumped into a problem.. (ajax loading stored urls) Thought someone could help.. First here is sample page layout: <div id="main-container"> <div id="top-menu"> <a href="/link1" rel="ajax" />Link 1</a> <a href="/link2" rel="ajax" />Link 2</a> </div> <div id="content"> <div id...

JQuery: My 'scroll' event is CRAZY slow. What am I doing wrong?

I have 4 DIV that I want to have a scroll event fired when you scroll on one of those div's. This is the code below. $('#div1, #div2, #div3, #div4').scroll(function() { alert('...'); }); In Firefox/Chrome, this runs fast; however, in Internet Explorer this runs so slow that it actually prevents me from scrolling the div. I'm usin...

How can I check the background color of a class using jquery?

I have set the background color of a class using css, now I want to put it in a variable using jquery. Thanks ...

Problem with jQuery Mouseenter/Mouseleave in Firefox

I'm having a problem with the mosueenter/mouseleave events only in Firefox... http://www.screencast.com/users/StanleyGoldman/folders/Jing/media/be3572de-9c72-4e2a-8ead-6d29b0764709 <HTML> <HEAD> <script type="text/javascript" src="http://code.jquery.com/jquery-1.4.js"&gt;&lt;/script&gt; <script> $(docume...

Can jQuery throw an error from my event handlers ?

Hello I have an error that occurs in a specific event handler that I setup using jQuery and the code just breaks without any errors being displayed. When I used to code similar things in YUI I would setup YAHOO.util.Event.throwErrors = true; in my dev. version and that was telling YUI's event handler to throw errors. I can't find anythi...

Please help me fix this Jquery function and figure out a fallback in case Javascript is disabled.

This code is supposed to get the id from a clicked anchor tag in the middle of a ul with the id 'links' and then use that id for other purposes across the page, however the alerts have shown me that I keep getting 'undefined' as if the element has no id. I double check my source code and they do indeed have ids, so I'm not sure what the...

Destroying Dialogs

I want to create a jQuery dialog from HTML returned by an AJAX call. This works, but "destroying" the dialog doesn't remove the content from the div. What is the best way to completely remove the content? Dialog creation code $.get( 'mysite/dialogcontent', null, function(data) { $(data).dialog( { buttons: ...

jQuery wrap syntax

It's end of day. I'm hoping I'm just having a lapse of logic. I can't get this to work: var $divA= $("<div></div>").addClass('classA'); var $divB= $("<div></div>").addClass('classB'); $myDiv.after($divA.wrap($divB)); The above should turn this: <div id="myDiv"></div> Into this: <div id="myDiv"></div> <div class="classB"> <d...

Empty div hover event not firing in IE

I have a div with a child div inside it. I'm using jQuery to show / hide the child div whenever a mouse hovers over the parent div (parent div spans the entire bottom of the page. Width: 100% and height 100px). I've used both firebug and ie developer toolbar to confirm that the parent div is on the page. I can hover over the empty paren...

Setting the value of a dynamically created text box with jQuery

Using the following code var newDiv = $(document.createElement("div")); var newTextBox; newTextBox = $(document.createElement("input")) .attr("type", "text") .attr("id", "textbox") .attr("name", "textbox"); newTextBox.val("text"); newDiv.append(newTextBox); alert(newDiv.html()); I get the following <input name="textbox"...

getting the X/Y coordinates of a mouse click on an image with jQuery

I would like to use jQuery to get the X/Y coordinates of a click event on an image. The coordinates should be relative to the image, not relative to the whole page ...

jQuery Fancybox - funny errors and no popup window

I am getting "is null" errors on a jQuery fancybox install here Here is the jquery: <script type="text/javascript"> $(document).ready(function() { $("a.video").fancybox({ 'zoomOpacity' : true, 'overlayShow' : false, 'zoomSpeedIn' : 500, 'zoomS...

jQuery each width problem

I have the following function set to run on a hover over an image: function() { $('.slides .slide h3').each(function(i){ var owidth = $(this).width() $(this).animate({"right":730 - owidth - 16}, 500); }); } You can view the page here. Over the image and click the next icon on the lower right of the image. For some reason,...

jQuery/JavaScript issues in Safari PC/Mac

Hey, I am almost finished a contract right now, and it appears at the last minute that most of my javascript/jQuery isnt working in Safari on either PC or Mac. The whole site is designed with progressive enhancement and unobtrusive javascript to turn ?p= links into # hash links, fade pages in and out, and have smooth rollovers - all of...