jquery

InnerHTML attribute empty on span tag during page submit - jQuery/ASP.NET

I have a hidden TextBox control on my page that updates a span tag on the keyup event using jQuery. When the page is posted back to the server, the innerHTML attribute is empty. How do I get the value that was set during the keyup event? Client side code: <script language="javascript" type="text/javascript"> $(document).ready(fun...

jQuery: How to get return value of function as value of id attribute?

I'm trying to create a new tr element and set it's id attribute to the last id in the table of my MySQL db. Here's what I have, but this does not set the id properly: $('<tr>').html(response) .attr('id',function(){ var daId; $.get( '/getlastid.php', null, function(response){ daId = response...

jQuery - How to use Each() Method to loop through and alter all checked boxes on a page load

Hi, I'm loading a web page that has a series of 20+ checkboxes. The page is being loaded with data from a database, so that some of the checkboxes will be checked, and textareas connected to those checkboxes will have some text in them. What I think I want to do is: 1) iterate through all the chekboxes and find the ones that are checked ...

jQuery: dialog question - change button after init

hi all, i've defined a dialog with 2 buttons: ok + cancel. what i want to do now is change the ok button's function after initialization, so i tried: dlgPrompt.dialog({ buttons: { 'Ok': function() { myFunction(); $(this).dialog('close'); } } }); unfortunately it doesnt work (when clicki...

Best Way to Extend a jQuery Plugin

I'm a fairly new jQuery user looking to extend an existing jQuery plugin that does about 75% of what I need. I've tried to do my homework on this. I've checked out the following questions on stackoverflow: Extending a jQuery Plugin Extend a jQuery Plugin jQuery: extend plugin question I've read up on the extend method. However, al...

Pseudo-Continuous Scrolling

I would like to display a large number of results without multiple "pages" to load results "0-99" on page 1, "100-199" on page 2, "200-299" on page 3 etc. Thus my idea is to create a sort of pseudo-continuous scrollable data list. So essentially, data would be loaded as necessary but only if scrolled to. The box of data would then woul...

JQuery Form Post not sending FormCollection to MVC Controller

Hi All, I'm attempting to change the data in PartialView within my view via a dropdownlist change in the form. Now if I hit the submit button my form posts no problem and the formcollection is available, however when I try to submit via jquery on a change event the form submits alright but no formcollection Any ideas? This is the submi...

How to call javascript function on a Silverlight 3 object?

I have the following Silverlight control defined: <object id="objImageViewer" data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="500px"> <param name="source" value="../ClientBin/SomeImageViewer.xap"/> <param name="onError" value="onSilverlightError" /> <param name="background" va...

Radio button selection on jquery tabs label click

I had a simple working (ASP.NET) Scenario here: 3 asp:RadioButtons that each have OnCheckedChanged event that will update an asp:gridview. But now, I want to put some description for each radiobutton selection,and I thought it would be a good idea to embed them in JQuery UI Tabs like the following : <div id="tabs"> <ul> <li><a href...

Making JQuery LightBox Plugin work with multiple galleries

Hi guys... I'm trying to make this jquery plugin => http://leandrovieira.com/projects/jquery/lightbox/ work with multiple galleries on the same page. The problem is, everytime I click on a picture from a certain gallery, I get all the pictures from all the galleries on the same page. Let's say i've got 2 galleries of 6 photos each. If I...

Jquery slider: smooth click animation

jquery sliders contain a "animate" opton that when set to "true" will slide the handle into postion when the slider bar is clicked. Im using my slider to scroll the content in another div, creating a similar eeffect as the one on the apple website. http://www.apple.com/mac/ the problem is that when i click the sliderbar it smoothly ani...

Reset state of button

Hi, on my website I have 4 css styled buttons in the header of a table. When each button is clicked it currently changes the css correctly as per the below script (the below code may not be the easiest/most efficient way I am achieving this result). What I would like to achieve is something similar to a radio button in that when each ...

jQuery: How to attach submit event in Firefox and Internet Explorer?

I have the following handler in my page that works fine in Firefox, but apparently is not being attached in IE8, since it adds the parameters to the URL, and does not make any ajax calls the server: $('#editBox form').live('submit',function(event){ var daId = $('#editBox #id').val(); $.post( '/edit.php', ...

jQuery: conditionally executing without "if"

Is there a way in jQuery or javascript to ignore all operations if the wrapped sets size is 0 withoug using if statement. menu.find('a[href="#add"]'). {code that should execute only if size()>0}; I guees I would normally have to do something like this var m = menu.find('a[href="#add"]'); if m.size()>0 { do something } Is there a ...

keypress event not working properly in safari and in Firefox with jQuery 1.3

The code snippet is here If I replace keypress with keyup or keydown, it works fine. As per jQuery documentation event.which should work fine. Update: Very bottom of this page says: If you need to detect these keys, do yourself a favour and search for their keyCode onkeydown/up, and ignore both onkeypress and charCode. Looks like ke...

Is is possible to bind a submit() function before any existing onsubmit/submit?

I have a form with an onsubmit attribute. I need to bind a new submit event and I need this one to be executed before any existing submit functions. The following code demonstrates the problem. <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Test</title> <script type="text/javascript" src="http://ajax.googleap...

Force cache flush in browser

I just made quite a large update on a website that uses asp.net. In the new update I have changed a lot of the code so that I use jquery instead together with asp.net web service. Many of my users have problems with that the new update doesn't work until they flush all cache in their browser. As it's a lot of work to tell everybody to fl...

Wrapping up Elements with JQuery

Hi Everyone, I do have a element and its content some where on the page : <div style="padding-bottom:9px; font-size:13px;line-height:25px;"> Fine quality, full grain pebble leather <br> <div style="line-height: normal; margin-bottom: 6px; "> Sophisticated black with detailed accent lining </div> Tailored satin...

How to set errorContainer in jQuery validation dynamically?

Can I dynamically set errorContainer in jQuery validation, which means showing different error container base on the button clicked. This is what I am trying to do, but seems doesn't work: $('#b1').click(function(evt) { $('#form1').validate().resetForm(); validator.settings.errorContainer = $('#m1'); valid...

select a different element other than the one clicked

How do I select an element with jquery, when a different element is clicked, when you don't know the name of the element? The code below is looping over the all the categories. I don't know how many categories there are, or what the names will be. When the 'insertUrl' link is clicked, I need to select the text area. The only thing I ca...