jquery

Use a checkbox to toggle the display of a page element (IE7 problems!)

When users check the "My shipping address and billing address are the same" checkbox, I want to hide the shipping address form. This code works well in everything except IE: $("#order_shipping_same_as_billing").change(function() { $("fieldset.shipping").toggle("blind", { 'direction' : 'vertical' }, 50); }); IE doesn't register the...

Is there an automatic jQuery plugin updater?

Is there some sort of utility available that will check my jQuery plugins and see if they are the latest version? I understand that there is not an easy way to check the version numbers automatically; but I wonder if anyone has taken a look at this. ...

Simple ajax onclick question

Hi, I'm having difficulty setting up a simple menu that displays results on a div box: I have a list of 10 links which link to php files on my server that return data. I would like it so that when the viewer clicks on one of the links, the data from the php file will display on a div box on the screen, and then when he clicks on anoth...

Update multiple div's from jQuery ajax response html

I have a page in a asp.net mvc shopping cart which allows you to enter a coupon and shows an order summary along with other page content. I would like to have an Update button which will validate the coupon code, report any errors and also update the order summary on the page via jQuery ajax. I know I could do this by making a form and ...

jQuery Sortable - events being called too many times

I have a list with class x and in that list is a number of lists with class y. It is possible to drag an item from any of the sublists to any of the other sublists It is also possible to arrange the order of the sublists themselves. I'm struggling with the events which are fired through the sortable Receive - only triggers when somet...

dynamically create radio buttons?

Referring to http://stackoverflow.com/questions/702925/creating-dynamic-radio-button-w-jquery , I was thinking how can this be handled if the input value('red' or 'blue') is retrieved from the database on a page load. Taking the same example from the above link, if Red, blue or other dynamic values, how can we build radio buttons on the...

jQuery selector problem

Here is my html source code: <ul id="accordion"> <li><h3><a id="1"></a></h3></li> <li><h3><a id="2"></a></h3></li> <li><h3><a id="3"></a></h3></li> </ul> and javascript <script type="text/javascript"> $(document).ready(function(){ $('#accordion li h3').click(function(){ //I want to alert the id attribute of a, but i don't kn...

jquery - get class of clicked li element

Hi there, I can't figure it out how to get an element of a clicked list item. When I use this I get "node-205" every time. .find('> ul') .tabs({ selectedClass: 'active', select: function(event, ui){ $(this).children('li').attr('class')) // this shows only the first element of the list } , cookie: { expires: 0}, fx: fx }) the...

Open Jquery modal dialog on click event

Hi all, The below code works fine for only the first click event. However for any subsequent click nothing happens. I tested this on firefox, ie7 but still the same. Am I missing something? The below code works fine if i click the <script type="text/javascript"> $(document).ready(function() { //$('#dialog').dialog(); $('#dial...

IE 7, Javascript transparent div onclick

Well i have a transparent div or the background is set to transparent :) css: #lowerLayer { position: fixed; top: 0px; left: 0px; right: 0px; bottom: 0px; width: 100%; height: 100%; background-color: Transparent; cursor: help; z-index: 1; } The div is placed right under the tag.. and under ther...

Removing <link> element with jQuery?

Hello, I don't want to use styles from style.css, so I decided to remove style.css from DOM. This work just fine in Firefox and IE8, but not in IE6: $("LINK[href='http://www.example.com/style.css']").remove(); Any other solution, with jQuery? Here is example: HTML: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ...

How to add id to input?

My CMS is very old. It gives the following HTML. I want to add id to each input and id name which is a text from the previous td, such as navn, e-po, hjem etc. Id can be 4 letters. I tried this code, but it gives only id="----" to each input. <script type="text/javascript"> $(document).ready(function(){ $('table tr').each(function(){...

jQuery different click action on the last item of a link list

Hello, everyone Let's say we have the following list: <ul> <li><a href="#">Link 1</a></li> <li><a href="#">Link 2</a></li> <li><a href="#">Link 3</a></li> <li><a href="#">Link 4 (different action)</a></li> </ul> Is it possible to assign a different click action on the last item of this list without any addition markup? I mean...

Jquery append() isn't working.

I have this <ul> <ul id="select_opts" class="bullet-list" style="margin-left:15px;"></ul> This javascript code which is meant to go throug a JSON object and add the options to the UL: $.each(q.opts, function(i,o) { var str=''; str+="<li id='li_" + i + "'><input type='text' id='opt_" + i + "' value='" ...

jQuery radio onchange toggle class of parent element?

Hi, Please have a look on the following: $('#myRadio').change(function() { if($(this).is(':checked')) { $(this).parent().addClass('green'); } else { $(this).parent().removeClass('green'); } }); Markup lookslike somewhat as following <table> <tr> <td>Some te...

jquery autocomplete and jQuery UI Dialog

Hi guys, I have a question about how to collaborate auto complete with UI dialog: There is an input text which enables autocomplete(the data is not a simple string array, so it needs to be parsed). This job is well done.: $("#styleno").autocomplete("${suggest}", { parse:function(raw){ var parsed = []; ...

Jquery sortable list won't serialize, why?

I'm implementing a sortable list of images with jquery in a Zend Framework application. I just can't get the .sortable('serialize') method to return more than an empty string. When I try with a few simple examples outside my application it works. Does it matter that the snippet below is wrapped in various other and other tags. I think...

Jquery: ajax post and encoding

I am unable to understand why I can't get a correct ISO-8859-1 charstet from the server answer. Being this a work on legacy code, i hardly could change charset encoding on the pages. I make use of the JQuery call $.post("server-side-code", {t:ctext, i:ioff, sid:sessionid}, function(data, status) { $('#chk').append(data); }); post...

jQuery return true or false if a div contains a <p> tag

Let's see: <div><p>this div contains a p tag</p></div> <div>this one is not</div> How do i assign a variable with a boolean value (true or false) if a div contains a specific tag like p in the above example? ...

Why is jQuery UI dialog.('Close') firing too early?

I'm trying to create a popup message in my app. On success I want to open a dialog, animate it...and then close it. I guess a better question should have been, "How do you create a timed popup in Jquery...but anyway when I run my code it appears that my dialog appears for just a split second. If I remove the dialog('close') line it wo...