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...
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. ...
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 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...
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?
...
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...
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...
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...
I have set the background color of a class using css, now I want to put it in a variable using jquery. Thanks
...
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"></script>
<script>
$(docume...
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...
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...
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: ...
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...
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...
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"...
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
...
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...
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,...
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...