jquery

JQuery select remove where class != "dgItem"

Hi i want to remove the following <tr><td style="padding-left:20px;" class="content"> This works fine with $(".content").first().remove(); But on some of my pages I have this <tr class="dgItem"><td class="content"> And it gets removed. Is it possible to make the JQuery only select the first example? ...

Jquery JStree plugin form text field conflict

I have a set of custom PHP forms within a set of Drupal pages (not generated through Drupal forms API - I won't explain why I'm not just using Drupal for these forms here - a tad complicated) with text entry fields won't allow keyboard input - but will allow copy and paste. They populate correctly with default values, but just won't let ...

Subtracting values from multiple input fields

I'm using the following code to take the value of one field, subtract it from the value of another field and display the result. $(document).ready(function() { var numIn; var numOut; var total; $('#submit').click(function() { numIn = $('input.in').val(); numOut = $('input.out').val(); total = ...

Data array for jQuery AJAX success

On server I am returning an array after some operations. I want to work with this array after successing of AJAX. var addPaymentType = function(){ var data = new Object() data["function"] = "add"; data["payment_type_id"] = $("#payment_types").val(); data["data"] = $("#saveform").serializeArray(); $....

jQuery UI error .. only in incognito mode?

On this page I am getting an error in Google Chrome but only when incognito mode. It works fine in regular mode. Is there a reason why JavaScript would throw in error only in incognito mode? The error is in the jquery-ui.min.js file. Its an Uncaught SyntaxError: Unexpected token ILLEGAL ...

Jquery: is there a way to create functions in my small bit of code to make this faster/simplier/smaller?

I'm trying to find a way to make this smaller by using functions/variables in my jquery. $('.search-what-category').fadeOut('normal', function(){ $('.search-wrapper').animate({'height':40}) }) $('.search-what-category').fadeOut('normal', function(){ $('.search-wrapper').animate({'height':40}, function(){ $('.search-wra...

Search a multitude of arrays

Hey, I am searching each array separately for specific inputs from a user. if ($.inArray(i.val(), helloInputArray) > -1) { //IF HELLO if (hello == 0) { //HAVE YOU ALREADY SAID HI? r = Math.floor(Math.random()*4); o.html(o.html()+helloOutputArray[...

get the tab text on select jquery ui tabs

Hi I m using jquery ui tabs I can get the index of the selected tab on "load" (ajax) event $('#tabs').tabs( { load: function(e, ui) { if($('#tabs').tabs('option','selected') == 0) { } } }); Now i want to get the tab name for eg... <ul> <li><a href="newprofile.jsp"><span>Profile</span></a></...

Select box with 'Other' option to display input text field. How to get value back for form submission using jquery?

I've got a form with the following select box: <fieldset id="workers_comp_info"> <p> <label for="i_n_r_reason">Reason why Workers Comp Insurance is not required:</label> <select name="i_n_r_reason" id="i_n_r_reason"> <option value="No employees">No employees</option> <option value="1-2 employees">1-2 employees</opt...

jquery - Hide #test if anything else than #test or its children is clicked?

The title sums it up. I simply want to hide #test when anything else than #test or its children is clicked. Thanks a bunch! ...

Jquery ajax call to a xml file works in safari bot not in IE6, why?

Im trying to load an xml file using the jquery ajax function,it works fine in safari but fails in IE6,is there any reason why this the case? <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; <html xmlns="http://www.w3.org/1999/xhtml"&gt; <head> <...

How to get the value from the anchor href?

I have an anchor like <a href="/category/post/?type=234#content">link</a>. Using a jQuery is it possible to get the value of "type" in URL and assign as a value for a hidden input type in same page without refreshing the page. ...

Setting radio boxes to be checked with jQuery

I have a page with some radio buttons that I want to be checked on page load. This is the jQuery that I'm using: $('.optionHolder').find('input').first().attr('checked', 'true'); The one's I want checked are the first input elements of each .optionHolder on the page. At the moment there are two, but the code above is only checking one...

Attach a click() event to the FaceBook 'Like' button?

I'd like to do something on the page when a user clicks 'Like'. I thought something simple like the following would work: <script type="text/javascript"> $(document).ready(function () { $('.connect_widget_like_button clearfix like_button_no_like').live('click', function () { alert('clicked'); }); }...

Input field is clearing text when I'm telling it not to ..

I have an input field that was written with onfocus="this.value='' , but recently decided to change it to onfocus="this.select() . The trouble is that when I went to change it, it still clears! I searched my entire javascript library, html, everything looking for what could be causing that. Nothing is being called of the likes. I tried ...

Jquery simple model view problem

I am trying to make little photo gallery with help of model view. But when I click on photo model views opens and shows photo but also it deletes it from photo gallery.I used append to create on model viev user information. <div class="userList"> <div class="user" href="#?w=500" rel="popup_name"> <img src="style/images/category/1.jpg" ...

How to set ASP dropdownlist to read only with css or javascript?

I have to set dropdownlost to read only. I can set enabled =false. But I cannot set font color to regular dropdown text. It will show like blur. The samething I did textbox.readonly=false. There we can see font same as regular text, no change. The same way I want read only for dropdownlist. Is there any way we can do with CSS or javasc...

How to select this via jQuery (include text in selector)?

What is a safe and reliable way to select the link below? I am having trouble to ensure I include the "Select" text in the selector to ensure I do not select another link: <span class="pickerWrapper">....<a href="...">Select</a></span> ...

Endless fade looping with jQuery image rollover effect

my intension was to replace images with nice fade effect: i have one image A as background. on mouse hover, image B fadeIn. on mouse out, image B fadeOut and we can see image A again. i'm using this code: <script type='text/javascript'> $(function() { $("img.fade") .mouseover(function() { ...

How jQuery Snap To Elements Works?

I was puzzled when I saw jQuery "Snap to element". Does anyone know how can I implement it without jQuery, with just raw javascript. Thanks ...