jquery

jQuery serialize function with multple forms

I'm using the jQuery .serialize function and can't get it to serialize the proper form on submit. my js code: function getquerystring(form) { return $("form").serialize(); } my forms: <div class="leave_message_box"> <form name="leave_message_form"> <input type="t...

How to make only specific text clickable on accordion header - jquery?

I added delete and edit link to the accordion header, yet those links are not working since every time i click on them the accordion open. And advice on how can I do it? Note that I'm doing nested accordion. this is how i defined it on js: $("#acc2").accordion({ alwaysOpen: false,active: false,autoheight: false, header: 'h3.ui-accor...

What is the correct way to bind events in jQuery?

For example in php I have a list of clients: foreach($clients as $client) echo '<li id="client_'.$client->id.'">' . $client->name . '</li>'; What is the correct way to bind a click event to each list item w/o using onclick="my_function(the_elements_id)" right in the list item. ...

sIFR dynamically changing the color of text onhover of parent element

Hi dudes, dudessessess, I'm using sIFR to style headings and want to dynamically change the color of text (within the flash movie) onhover of parent element. How would one do this? Any examples? I have never seen it done. <ul class="tab"> <li id="tab2"> <a href="#two"> <span class="organisation sIFR-replaced" s...

Ajax Call inside a each() Loop not being asynchronous

Hi What I'm trying to do involves going through a series of checkboxes. For each one of them that it is checked, I have to perform some calculations (using an ajax call). If there is an error, I have to break the loop and return a message. Every ajax call takes about 0,4 seconds to perform but that shall never be a problem because I c...

$.get to load and show content in div only once content, including images, are ready.

I am using a get to load content to a div and then show it. Works great, very easy. $.get($(this).attr("href"), function (data) { $('#boardData').html(data); $('#boardContent').show(); $('#BoardImages a').lightBox(); }); I would like to only show the div, my $('#boardContent').show();, once all of the images have loaded from my...

Wrap three repeating div groups into one using jQuery

Hi all, I have another problem here. I have few repeating groups of divs. There is 3 divs with different classes in one group. What I need to do is wrap the into one 'container'. When I'm using wrapAll it wraps all into one div. And this is my html: <div class="bb_box_tl"></div> <div class="bb_box_l"></div> <div class="bb_box_lb"></d...

JQuery draggable element with image - problems dragging in IE and Chrome

I have divs that are defined as draggables. The divs contains one image and some text each. Dragging works perfectly in Firefox and Opera, but in Chrome and IE I can only start the drag by mousedown on the text, not the image. When I mousedown on the image in IE and Chrome, the built in html element drag-drop browser function kicks in - ...

How to disable JQuery keypress event for just one element?

On my site I have registered a keypress event handler for the whole document. $(document).keypress(myhandler); And I handle the 'space' key to scroll a list. Trouble is, there is an <input type='text' /> element, and I don't want 'space' keypress to scroll the list when it is entered in the input. I couldn't find any information in ...

Cycle Pager auto advance with Pause/Play

hi guys i've managed to work out who to make a pager gallery using the cycle plugin WITH auto advance $(function() { $('#s4').before('<div id="nav" class="nav">').cycle({ fx: 'fade', speed: 'slow', timeout: 6000, pager: '#nav', before: function() { if (window.console) console.log(this.src); } }); }); howeve...

Jquery $.post() - Possible to do a full page post request?

I know I can do an out of band Post request with Jquery and the $.post( syntax. However, I'm interested to know if it is possible for jquery to cause a post request on the whole page (as when a form is submitted) so that a brand new page is loaded. Is this possible? Thanks There is no form element in the DOM, so I can't do form.subm...

jquery CheckBox required

hello, how can I make a checkbox required ? my code aspx: <asp:CheckBox ID="cbIsAgree" CssClass="{CheckedBox:true, messages:{CheckedBox:'check me!.'}}" runat="server" Text="check me!" /> javascript : $.validator.addMethod("CheckedBox", function CheckedBox(value, element) { return $(element).is(':checked'); } , 'che...

Disabling ajaxSetup Defaults for some AJAX Calls

The corporate intranet I built heavily uses AJAX calls to load tables and other resources. By default I have a modal dialog box appear with a loading gif to let the user know the page is loading. I set this default up with jQuery's ajaxSetup. There are a couple of areas where I use a search box with autocomplete. And I noticed ever...

selecting textareas

Hi, I am trying to select specific element types in a row and change their attribute, specifically the id and name attributes. Using the following works fine for single line text input boxes: $('input:text', newRow).attr('id','os' + newRowNum ).attr('name','os' + newRowNum ); however, when I change the html to: <td><textarea name="o...

On load, jump to anchor within a div

Let's say I have the following page: <html> <body> <div id='foo' style='scroll:auto;height:400px'> // content, content, content... <div id='bar'></div> // content, content, content... </div> </body> </html> What jQuery (or vanilla Javascript) can I use so that when the page loads, it jumps to #bar only within the div...

drag and drop from outlook to webpage

I'm looking for the following functionality and a push in the right direction if it is possible... I would like to be able to drag an email that I have in Microsoft Outlook over to a webpage and have the webpage parse out details within that email. Is this possible? The intent is to take that data and interface with our help desk soft...

ui.datepicker.js calendar autoUpdate another calendar when date change.

Hi, I'm using ui.datepicker.js In my edit form I have 2 calendars that have their own function. Calendar A : is the date that the invoiced is created Calendar B : is the date for next billing Bill_freq is the field where is set the billing frequency (every 1 month, 3 months, 6 months, 12 months) What I want to do is when date is chan...

jQuery update does not work with IE7/8

With the help of members from this post, I converted from prototype to jQuery. function jsUpdateCart(){ var parameter_string = ''; allNodes = document.getElementsByClassName("process"); for(i = 0; i < allNodes.length; i++) { var tempid = allNodes[i].id; var temp = new Array; temp = tempid.split("_"); var real_id = ...

calling __dopPostback from javascript where target control is an ASP.Net custom control

I need to pop up a jquery dialog as confirmation before a submit happens. I don't want the dialog to always pop up, that depends upon the setting of a dropdown. The submitting control (which I can't change by the way) is a custom control with a save and a cancel button and handlers for the save and cancel buttons. So when the user has ...

How do I access an '@attr' value in JSON with jQuery

I'm working with the last.fm api to get artist images, and I'm getting JSON results where I need to check an '@attr' value. Unfortunately, I can't seem to access this value. The results look something like: {"image":[{ "url":"http:\/\/www.last.fm\/music\/Undefined\/+images\/3040021", "format":"jpg", "sizes":{"size":{"#text":...