jquery

jQuery: Hide popup if click detected elsewhere

I'm trying to hide a div if the user clicks anywhere BUT the popup OR it's children. This is the code I have so far: $("body").click(function(){ var $target = $(event.target); if(!$target.is(".popup") || !$target.is(".popup").children()){ $("body").find(".popup").fadeOut().removeClass('active'); } }); It works for ...

Difficulty setting custom DDL's value with JQuery

EDIT2: I tried something new I added this line of code: $(self.ddlOwner + "option[value='" + this.owner_USER_ID +"']").attr("selected", "selected"); However this line of code does in fact set the value correctly but it does so on all the DDLs on the page. So if the value is 1 all four DDLs I have on the entire page set the value =...

JS/jquery why doesn't this work?

function checkSession(){ $.ajax({url: "session.php", success: function(data){ if( data == 1){ var postFilen = 'msg.php'; $.post(postFilen, function(data){ $("#msg").html(data).find("#message2").fadeIn("slow") } } else { $('#message2').hide(); ...

jQuery Add/Delete

This snippet does what I want it to do with 1 exception. It works correctly if the user presses "Add" over and over again - it removes the empty row and adds the new row. If the user types something into the input field, that field is converted into table data. The only problem I have is when the user presses "Add" twice, and the second ...

jquery cross browser copy text to textbox issue

Dropdown In my site I have a set of SELECT dropdowns that are set up like this. <OPTION class="addTitleTag">400</OPTION> Search Box There is also a search box that is like the following. input type="text" class="textbox" onblur="search_SearchBlock_blur()" onfocus="search_SearchBlock_focus()" value="Search" name="g2_form[searchCrit...

jqgrid redirect to another page when row clicked

I am trying to use jqgrid list for a specific project. I read the online documentation posted but I could not find solution to my problem. I dont have problem with listing and viewing items. But I need to a button in each row and when that button clicked, browser should be redirected to another page (where that row can be edited. eg: ?Se...

JQuery: .each how to reference matched object

how do i get a reference to the element that matched? 'this' is not correct. For example here I am trying to alert with the elements value. //how do i get this to reference the object it matches. $("#txtFirstName,#txtLastName,#txtDOB").each( function() { alert(this.val()); } ); ...

JS to jquery to the fullest

hello. I have this: function createObject() { var request_type; var browser = navigator.appName; if(browser == "Microsoft Internet Explorer"){ request_type = new ActiveXObject("Microsoft.XMLHTTP"); }else{ request_type = new XMLHttpRequest(); } return request_type; } var http = createObject(); var nocache = 0; function insert() { doc...

How to disable mouse scroll-wheel scaling with Google Maps API

I am using Google Maps API (v3) to draw a few maps on a page. One thing I'd like to do is disable zooming when you scroll the mouse wheel over the map, but I'm unsure how. I have disabled the scaleControl (ie removed the scaling UI element) but this doesn't prevent scrollwheel scaling. Here is part of my function (it's a simple jQuery ...

jquery tab displaying problems

how to get rid of the orange background image in the tabs??? EDIT i tried $('.ul').removeClass('ui-widget-header '); $('.li').removeClass('ui-widget-header '); $('div[id^=tab]').removeClass('ui-widget-header'); $('a').removeClass('ui-widget-header'); but no result! ...

JQuery - checkbox enable/disable

I have a bunch of checkboxes like this. If the "Check Me" checkbox is checked, all the other 3 checkboxes should be enabled, else they should be disabled. How can I do this using Jquery? <form name="frmChkForm" id="frmChkForm"> <input type="checkbox" name="chkcc9">Check Me <input type="checkbox" name="chk9[120]"> <input type="checkbox" ...

Why does this jQuery resizable handle disappear when the div is updated?

I'm using jQuery UI's resizable function to resize a div containing an image. On initial page load, the div contains someimage.png and the resizing works fine with the code below. The handle appears on the bottom right corner and I can click and drag it to resize the div. jQuery("#imgdiv").resizable(); <div id="imgdiv" class="ui-wid...

does Ruby on Rails have a way to use jQuery rather than Prototype under-the-bonnet for its ajax view helpers? (e.g. "link_to_remote")

Hi , Does Ruby on Rails have a way to use jQuery rather than Prototype under-the-bonnet for its ajax view helpers? (e.g. "link_to_remote") ...

Can't retrieve dynamically created element's .html() value in JQuery.

I created a simple Import script that takes a CSV processes it in PHP and returns a HTML table (essentially a user list). This is the HTML output: <tr id="user:1"> <td id="first:1">Jane</td> <td id="last:1">Doe</td> </tr> <tr id="user:2"> <td id="first:2">John</td> <td id="last:2">Doe</td> </tr> This HTML data is initially r...

CSS, jQuery and Navigation Control - a minor tweak needed

I have a navigation that uses jQuery and CSS to control image mouseover positioning and dropdown menus. Everything works as it should. I have a request from the client though to make one modification. You can see the example here: http://www.rouviere.com/jr/index.html (best viewed in Firefox or Safari right now) If you mouse over the l...

JQuery UI Modal only works first time

I am using JQuery UI to show a modal, after I do a lookup on an input field value. This has to fire every time the value changes in the input field. My problem is, that the modal only displays the first time the code is called - not subsequent times. I know the code runs, because I tried putting alerts in there - that displayed just as ...

Calculating the time between two clicks in Javascript

Hi everyone, I want to calculate the time between two clicks of an attribute with javascript but I don't know how. For example; <a href="#">click here</a> if the user clicks more than once -let's say in 5 seconds- I want to display an alert. I'm using jQuery if that helps. I don't know much about javascript but I've been coding a sm...

How can you use jQuery to do something to a certain string in the page text?

Is there a way to use jQuery to search a <p> and do something to each occurrence of a string. For example make every string "magic" in the page bold? Is there a way to do it for a character so that every 'a' could be made bold? It appears contains just gives the element that contains the text and not the string itself. ...

Jquery select value passing

Hello. How do I get current value of an html select then pass it to another html select after a "click" event via jquery? Thanks. ...

jQuery: inserting and removing rows from a table

This is some code to allow the user to insert/delete rows. Because focusout occurs before the click event, I have to save which row to be removed until after the new on has been inserted. Q: Am I handling the variable named ROWTOBEREMOVED correctly? It's in all caps for the purpose of this question only. <!DOCTYPE HTML> <html> <head> <s...