jquery

Submitting a form with JQuery Ajax results in multiple requests (and submissions)

Hi. I have run into an issue with JQuery form submissions and have found no answers anywhere . If someone could shed some light on this, it would be highly appreciated. The issue: The first time I submit the form, it works fine. But if I submit the same form a second time, it sends 2 requests, 3 requests the third time, and so forth. ...

jQuery: finding ancestors siblings with matching content / tree walking

<table> <tbody> <tr> <td class="TargetRow">Not this one</td> </tr> </tbody> <tbody> ... </tbody> <tbody> <tr> <td class="TargetRow">This one</td> </tr> </tbody> <tbody> ... </tbody> <tbody> <tr class="ContextRow"> ... </tr> </tbody> </table> Given the above HTML ...

Upgrading :with parameter on a link_to_remote in Rails 3

What's the preferred UJS replacement for the Rails RJS helper ':with' parameter on a link_to_remote when upgrading to Rails 3 (using the new unobtrusive link_to... :remote => true syntax). eg. Replacement for: link_to_remote "Ajax Call", example_path(@thing), :with => "'foo=' + $('field').val()" Specifically, I'm looking into a link ...

jQuery and UserControl Property access

How can I access a asp:userControl's property using jQuery $("#<% =ucControl1.ClientID%>").find("[id$='Panel1']").hide(); I am trying to show an asp:Panel with the usercontrol and it doesnt work. <div id="ctl00_ContentPlaceHolder1_ctl02_ucControl1_Panel1"> content.... </div> The jQuery rendered is as follows: $("#ctl00_Content...

slide effect with jquery

hi I'd like to create a slide effect using jQuery. I have several div's: <div id='div_1'>content currently displayed</div> <div id='div_2' style="display:none">content to be loaded</div> <div id='div_3' style="display:none">content to be loaded</div> The idea is that div_2 appears while sliding and "pushing" div_1 out of sight, a lit...

JQuery How to select all anchors within current list item?

I wish to, using JQuery, show and hide some anchor tags as I hover over a list item. How do you loop through the current anchors within a list item using $(this) ? Here's what I have so far: $(document).ready(function() { $('.currentlist > li').mouseover(function(event){ // loop through each anchor tag within this list usi...

Ajax call in JsTree jQuery plugin in MVC

I am trying to get JsTree to work to get a folder view in my MVC application. Everything works fine if I use existing static html ul list in the page view. But I need to get the ul list dynamically, so I am trying the ajax call for JsTree described in the documentation: <script type="text/javascript"> var url; $(document...

sortable and draggable - cancel if item is already in sortable.

Hi everyone, Having a slight spot of bother... I have a draggable element that can be dropped into a sortable list. Ideally I would like to prevent draggable event creating a placeholder in the sortable if the sortable already contains an element with a matching class name of the draggable. Not had any luck with so looking at removin...

Jquery: how can I select cells from a table that contain a specified string of html?

I'm trying to style some cells of a jquery-ui date picker based on application logic. I need to be able to scan through a table and select cells that contain a specified string of html. Here's an example table: <table class="ui-datepicker-calendar"> <thead> <tr> <th class="ui-datepicker-week-end"><span title="Sun...

jQuery fading page redirect

I have a working jQuery page redirect. I want to fade into the page I am loading. $(function(){ var count = 5; countdown = setInterval(function(){ $("p#redirect").html("You will be redirected in " + count + " seconds"); if (count == 0) { window.location = 'http://link.com'; } if(count < 0) { $("p#redire...

Skipping Months

My calendar is not rendering days for April because when I view April in the calendar it starts with March 29. So it pulls data for March. My calendar view for April... 3/29 | 3/30 | 3/31 | 4/1 | 4/2 Since the month starts in March, I only get events for March. How do I fix this? ...

json request causes the browser to display a popup, I set JsonResult in the action

My code: [HttpPost] public JsonResult DoBlah() { .. return Json(mySerializedObject); } In firebug, I can see the response content type is using application/json. But for some reason, I get a popup with the json response. What could the issue be here? ...

Help changing image slider from img's to li's

Hi. I've spent numerous hours trying to figure out how to get this slider to use li's with background images rather than img's. The reason for this is that I intend to use the slider for Wordpress & many Wordpress themes apply their own css properties to images (such as 'max-width') which will often break the slider. I would appreciate ...

How to calculate where to add `<tr> and </tr>` when formatting JSON Data as an HTML Table?

So what I want to do I'm sure has been done thousands of times. I am just having trouble finding the solution. I am receiving some JSON data that looks like this {"ImageCollection": {"Images": [{ "ImageID":"68", "CatID":"1", "Location":"/Images/Art/Full/68.gif", "ClipLocation":"/Images/Art/Clips/68.gif", "FullHeight":"...

How do I add a callback function to .submit() in Javascript?

I am submitting a page onclick of a form element and need a function to run after the submit refreshes the page. I'm trying to add an animated scroll back to the clicked element that caused the submission. I've got the scroll part covered but I can seem to figure out how to cause the function I wrote for the scroll to run after the page ...

Jquery slide toggle dropdown disappears when mouse leaves

I've been trying to practice making sliding menus with slidetoggle, slidedown/up...etc but I can't seem to get this right if I want to hover over the menu. I've got this so far but it works only on click and it doesn't go away after moving away from the menu item. So I would like to just hover over the main menu item and then drop the ...

How to Copy Table Row with clone in jquery and create new Unique Ids for the controls

Hi, How to Copy Table Row with clone in jquery and create new Unique Ids for the controls.Clone will acually copy data also .i don't want data to be copied . The table row contains the following information: <tr> <td><input type="text" id="txtTitle" name="txtTitle"></td> <td><input type="text" id="txtLink" name="txtLink"><...

jquery datepicker defaultDate going to 23/02/2016!?

I've added the detaultDate to my datepicker, it is getting the default date from a database, if i look at the source code of my page when ran the defaultDate looks fine but it goes to a completely different date, date format is dd/mm/yyyy. $("#date").datepicker({ changeMonth: false, changeYear: false, dateFormat: 'dd/mm/yyyy...

if statement inside while loop. Why is it doing this?

I am using this: //if in landscape mode while(window.orientation == 90 || window.orientation == -90) { if(!$('#page' + hiddenNextPage).hasClass('showUp')) { $('#page' + hiddenNextPage).addClass('showUp'); $('#page' + hiddenNextPage).css('margin-left', '300px'); ...

Sort order of table tbody in same order as list elments jquery json

I have been working on this jsFiddle and wanted to extend the functionality so that when the list items have been altered and submitted via the form then the associated table tbodys sort themselves in the same order as their list item counterparts: http://jsfiddle.net/8vWXZ/20/ Is it possible to map the order from one element to anothe...