jquery

Jquery: display div based on the selection from DropDownList

I have a dropdownlist (asp.net) and when user change the selection and i want to display the div based on the selected from dropdownlist. i have code here... <asp:DropDownList ID="ddlFilter" runat="server" Width="221px"> <asp:ListItem Text="Select..." Value=""></asp:ListItem> <asp:ListItem Text="Date" Value="DATE"><...

add id to dynamically created <div>

I have the following JavaScript that creates a div and then appends it to the body and then inserts some dynamically generated HTML into it. cartDiv = document.createElement('div'); This div I would like to add an id and/or a class to it. If possible both Jquery and JavaScript answers would be great. var cartHTML = '<div class="soft_add...

checkbox state should retain state to hide/unhide text on pageload

as a follow up to this question, while the checkbox value is stored on pageload, the text is displayed on pageload, even if the checkbox is unchecked. the text should hide/display only if the user has unchecked/checked the checkbox, throughout the session or till he closes the browser. js code which stores the checkbox state: functio...

jQuery and ajaxSend not firing

I set the global ajaxSend callback as below in my $(document).ready function. // global AJAX methods $(document).ajaxSend(function(e, xhr, settings) { alert('here'); }); However, I am never getting here even though I have several $.ajax() calls that run successfully after the document has loaded and on demand. Yet, here appear...

Calling a webservice using JQuery

I am using this code from http://www.joe-stevens.com/2010/01/04/using-jquery-to-make-ajax-calls-to-an-asmx-web-service-using-asp-net/ function callWebService(address) { var result; $("#result").addClass("loading"); $.ajax({ type: "POST", url: address, data: "{}",contentType: "application/json; charset=u...

cant get values to keep adding to input

I have an issue which I hope someone can help me with. I'm able to retrieve the text value of my checkbox. What I want to achieve is every time I click on a checkbox, it adds the text to the input with an id of "Selected". for example: if checkbox a, checkbox b, checkbox c are checked, I want to show "a, b, c". Instead what I'm getting a...

jQuery dynamically generate grep()

Hi, I'm using $.grep() to pull back a set of JSON results like so: myObject.appJSON = jQuery.grep(myObject.appJSON, function (a) { return a.category == "Entertainment"; }); and it works fine. But what I really want to do eventually is have several checkboxes so that that I can filter on several different things. I real...

How can I select elements living in a certain range of the DOM hierarchy?

I have a DOM element C which is a descendant of DOM element A. There are several layers between them, one of which is an class of element named B. If I have jQuery("#A") and jQuery("#C), how can I find the parent element of C with class B, which is also a descendant of A? If I use parents() of C then I could potentially get any elemen...

jquery response back

I am sending an ajax call to another page. I want to get a value of a variable, lets call it x, back from that page on success. How can I do that. here is my ajax code $.ajax({ type: 'POST', url: 'myotherpage.php', data: 'loginname=' + loginname , success: function(success) { if(success == 1) ...

popup problem : not showing proper corresponding content

iterating over an array, am printing some div content for each iteration. Whenever the user clicks on any div content, a popup should appear and should show the corresponding content in the popup from the array. below is my code, foreach ($email as $client) { echo "<div class = 't'> Show more....... </div>"; ...

Radio Buttons, Multiple Dialogs, Jquery

Hey Guys- So I'm trying to make my 3 radio buttons, each pop up with a different dialog box using jquery. (http://www.regrettablehookups.com/sandbox/contact.php) This is what I have in the header: //Radio Button $("#radioset").buttonset(); //Button $("#dialog_button").button({ icons: { primary: 'ui-icon-newwin' } }); ...

How to change the Date format that we get from text field "16-JUL-2010" to 20100716 using php or using jquery

How to change the Date format that we get from text field "16-JUL-2010" to 20100716 using php or using jquery ...

Code runs multiple times in IE/Opera

Hi, I have a problem on my page with code executing multiple times in IE and Opera, though it works in FF, Chrome and Safari. I am using the latest jQuery, the validation plugin and the form plugin. My code originates from the following html: <form action="/case_study/php/survey_submit.php" id="mt_survey" method="post"> ... ... ...

ASP.NET and JQuery - Popup for dropdownlist selected value.

What I'm looking to do is popup an "are you sure" confirmation box if the newly selected value of a dropdownlist is a certain value before I submit the form. <select name="ListSearchType" id="ListSearchType"> <option value="C">Closed</option> <option value="O">Open</option> <option value="P">Pending</option> </select> So i...

Shortening jQuery command

I was wondering if anyone knew a better way to write this block of code. if($('div.homeBox > div').length > 0){ $('div.homeBox > div').remove(); } $('div.homeBox').append(data.loadPage); This works as it is, but I would like to make it pretty if possible. I am replacing a block of code in my page with HTML data returned by an ajax ...

Why are some jQuery UI operations unsuccessful on disembodied DOM elements?

I tried creating a disembodied DOM element with jQuery (I avoid ever touching the DOM directly w/o going through jQuery, so I do treat their wrapped sets and the DOM elements underneath somewhat equivalently) and applying .tabs() to it, and only later adding the element into the DOM. The tabs kind of worked and kind of didn't. It seemed ...

Get Jquery modal box to appear on page load

I need to get this Jquery box to appear on page load. Right now it only appears when the user clicks a link. Here is the trigger: <script type="text/javascript"> $(document).ready(function() { //select all the a tag with name equal to modal $('a[name=modal]').click(function(e) { //Cancel the link behavior ...

How do I loop through multiple tables with jQuery in a html file loaded with ajax

I am trying to parse a response data as html format. The data contains multiple tables (not nested tables). I load the html with ajax and trying to loop through the data with jquery. The problem is No result when I start with 'table' for looping (I have multiple tables and have no ID for the table.) When I use 'tr' It works well in firef...

Current index of the LI occurence

The scenario is described below. <li onmouseover="swapArrow_white()" onmouseout="swapArrow_black()"><a href="#">Menu<img src="common/images/downArrow.png" class="downarrow" /></a> <li onmouseover="swapArrow_white()" onmouseout="swapArrow_black()"><a href="#">Menu<img src="common/images/downArrow.png" class="downarrow" /></a> <li onmouse...

jquery reconstructing a selector from a string

I am taking the value of a select element and trying to modify it so that I can have access to the onscreen preview element that the select item represents. Here is the first part of the code... $("#single_area_select").change(function(){ var $element = '#preview_' + $("#single_area_select").val().toLowerCase(); elementC...