jquery

Asp.Net script in external js file

How can I use server-side script in an external js file to grab a reference to a dom element? The following works as intended when used as inline-script, but is returning null when I move this to an external js file. $("#<%= gridResults.ClientID %>"); ...

Deleting any element, the reassigning the count value

Sorry about the cryptic title, it's hard to describe! I am using the following script to add a row to my form when a button is clicked: $(document).ready(function() { $('#btnAdd').click(function() { var num = $('.clonedInput').length; var newNum = new Number(num + 1); var newElem = $('#input' + num).clone()...

jquery .text doesn't render HTML elements into the DOM

Hi I am loading a list of images into a div with the following bit of jQuery : var jewellerDdl = "<%= JewellerDropDownList.ClientID %>"; var filter = $("#" + jewellerDdl).val(); $.ajax({ type: "POST", url: "popup.aspx/GetJewellerAssets", ...

How to disable panning in Jquery flot when there is no further data ?

How to disable panning in Jquery flot when there is no further data ? I am currently using plot.pan({ left: -100 }); and plot.pan({ left: 100 }); on left arrow click and right arrow click. ...

AJAX FIle Upload: Filename doesn't appear in textfield of type file

Hello all, I am making use of Andrew Valums awesome AJAX file uploader. I am having a problem with it though, its a small issue. I want the file that was selected by the user and uploaded to be shown in the textfield. But it never seems to appear it just uploads. How can I do this or why is this happening? Thanks all ...

jQuery: select random elements

How Can I select the first 5 random elements <ul> <li>First</li> <li>Second</li> <li>Third</li> ... <li>N</li> </ul> I'm using this plugin: alert($("li:random").text()); but it takes all random elements. I only want the first 5. Or is there another way to do the same thing? Thanks ! ...

Submit unmasked form value with jQuery/meioMask

I mask the input of fields like SSN to contain dashes when they are displayed but would like the value that is submitted to be only the numbers. For example, my SSN is formated as: <input type="text" name="ssn" alt="999-999-9999"/> And upon entering "1234567890" I get the nice formatted output. 123-456-7890 Now I would like only t...

jQuery not working with Rails

So I'm trying to get some basic jQuery code with Rails working, but it doesn't seem to be working out. I've looked around and it seems like I'm following all of the directions correctly and have tried it in multiple browsers with no avail. Essentially, I'm just trying to slide up a div on document ready, but it just stays there :( <%= j...

keep borders in IE with jquery.corner()

Hey there, I'm using the jQuery plugin "corner": http://www.malsup.com/jquery/corner/ Its almost doing a great job making my divs round at the edges. The problem is, my divs have borders of 1px applied. This works great in Safari, FF, Chrome etc. Only in IE (8) the borders will disappear. It does render the edges round, but no borders....

retrieving $_GET variable in jquery

I have a main page (topic.php) with GET information in the URL, like this: http://studio.byuipt.net/topic.php?topic=Debugger&amp;desc=Helps%20find%20and%20solve%20problems%20with%20others%27%20code. I have a div, "currLeader" in topic.php into which I load another page, getCurrLeader.php. getCurrLeader.php is supposed to use the topic...

Items not added to ListBox after using jQuery .appendTo

Preface: First time really using JavaScript + jQuery, so my problem likely stems from a lack of understanding. I have some very simple Javascript to move elements from one ListBox to another: $('[id$=AddRole]').click(function () { $('[id$=MissingRoles] option:selected').appendTo('[id$=Roles]'); return false; }); $('[id$=RemoveRole...

jQuery UI Slide Effect Problems

I'm redesigning my company website and we're going pretty effects-heavy with jQuery, Flash, etc. So far I haven't had much of a problem doing any of this, but two minor issues keep cropping up and I've had nothing but success after asking people here, so here goes: Development page in question: (URL removed) First Issue Click on the...

jQuery, How to target very specific selectors?

Apologies if this has been asked already, I can't find the answer in the jQuery docs. How would I select all .tooltip classes which have a [title] attribute, and the [title] attribute is not empty? In other words, select these: <a href="#" class="tooltip" title="YES">Foo</a> <span class="tooltip" title="YES">Bar</span> But not these...

Page Loader with jQuery

Hi Gurus, What Im looking to do is something called 'loader' using jQuery. Basically on site after choosing one option site will search database and will return matching results. All that is happening without refreshing the page. Im looking to add "loader" - image that will appear while site is loading data from database and don't r...

jQuery contains

Is there a way to get the deepest element matching a contains statement? Basicly if I have nested divs, I want the last element not the parent element: <div id="hayStack"> <div id="needle">Needle</div> </div> $("div:contains('Needle')") is returning the hayStack div. The only solution I have come up with so far is explicitly exlcu...

How do I change the contents of a div inside a modal dialog using JQuery

I have the following jQuery dialog and I want to change the contents of a div inside the dialog just before I open it. However I can't seem to fathom it out, can any one help? <div id="dialog" title="Basic dialog"> <div id="data"></div> </div> $("#dialog").dialog({ bgiframe: true, height: 140, modal: true, autoOpen: false }); $("...

Dependency mismatch problem with Jquery

Hi, I am pretty new to Jquery, I am using validation rule against my textbox. The problem is when i mark textbox is mandatory n user doesn't input any value then it doesn't show any validation message. I have associated another validation message for textbox tht the value shu be in range and which works when user provides any input. $.v...

Delete a selected form element

I have a form element that needs to be deleted when a button next to the element is clicked. $('#btnDel').click(function() { var num = $('#input').prevAll().size(); $('#form div:nth-child('+ num +')').remove(); } Can't seem to get that working! Any help very much appreciated. I think I'm just confused with s...

Highlighting the "current" textbox on a web form

I have a data entry web app where the control that has focus is given a yellow background color (and when the user navigates away, it turns back to white). The script to do this came from I-don't-know-where, and it breaks in IE7 causing all sorts of problems, like drop downs not working (the script was designed to work on textboxes and ...

Only one AJAX request at a time?

I would like to make sure there is only one AJAX request going on (for a user) at a time. This is what I tried: var ajaxFinished = 1; $('#selector').keyup(function() { if (ajaxFinished == 1) { ajaxFinished = 0; $.get('test.php', { par : "par" }, function(data) { // do stuff with data ajax...