jquery

Checking if radio buttons are checked in Firefox

On my site, I have two checkboxes created in my ASP.NET MVC view like so: Html.RadioButton("check", "true", "true" == (string) ViewData["someKey"], new { id = "check1"}); Html.RadioButton("check", "false", "false" == (string) ViewData["someKey"], new { id = "check2"}); I am positive that ViewData["someKey"] has the value "true" in it....

JQuery - ajax load

Hello, I have a div: <div id="inner"> Some content... </div> Now I need to load some file into inner-block, but save it's old content. $('#inner').load( 'pathToFile.html' ); Will replace old content of div. Thanks. So, as I understand my code should be: old = $('#inner').html(); $('#inner').load( 'pathToFile.html' ); $('#i...

JS Object this.method() breaks via jQuery

I'm sure there's a simple answer to this, but it's Friday afternoon and I'm tired. :( Not sure how to explain it, so I'll just go ahead and post example code... Here is a simple object: var Bob = { Stuff : '' , init : function() { this.Stuff = arguments[0] } , doSomething : function() { console.log( this.Stuff ); } } An...

Selecting element type with attribute value in jQuery

Good morning, everyone. Can someone please let me know the correct way to select an element type with a given attribute? In my particular case I'm trying to access a label with a an attribute of "for" that has a value of "P500_CB_TRANSFERUNIVERSITY". I would have though the propery jQuery syntax would be something like $('label [for=P...

JSON object max size?

Using jquery, I'm able to send json objects from client to server using ajax like this: var strJSON = '{"event":[{ "dates":[ "2009-10-14","2009-10-15"], "teams":[ {"id":"0","country":"USA","state":"CA","name":"California Polytechnic State University","subteam":""}, {"id":"1","country":"USA","state":"CA","n...

Identifying the Form that is being Submitted using JQuery

Hello all, I have several forms on a page with different ids and I want to find out which is submitting and its id. How can I do this? //stop all forms from submitting and submit the real (hidden) form#order $('form:not(#order)').submit(function(event) { event.preventDefault(); The above stops all forms submitting and I would like pu...

pass all select values to php

i have one select box <select name="sub_selected" class="bmarks" id="sub_selected" style="width:400px" size="5"> <option value="1">first value</option> <option value="2">second value</option> <option value="4">other vale</option> </select> i want to pass all values to php i write following ...

get all values of ul in to varaible

i have ul like this <ul class="options" id="selt_count"> <li value="1">One</li> <li value="2">Two</li> <li value="5">Five</li> <li value="12">Other</li> </ul> what i want is: get all values of of li into variable in following format (1,2,5,12) in jquery Thanks ...

Passing Multiple Json Objects as data using jQuery's $.ajax()

I am POSTing data to an MVC controller and I'm attempting to maintain state as well for optimistic concurrency. I'm currently posting back a JSON request, but would be open to workable alternatives? I am already posting a name/value collection with the following command: $.ajax({ url: g_appPath + "/Rounding.aspx/Round/" + $("#Offe...

How to make a "recursive" accordion

Hello, I found this code on here from this post: http://stackoverflow.com/questions/332384/jquery-accordion-links-dont-work and it is almost what I need. But what I want is so when you click on one of the tabs instead of showing text it brings up another set of tabs that you can click on and then the same thing happens when you click on...

jQuery plugin callback

ok, so what i'm trying to do is a plugin that returns a jquery array to be used in a callback function. let's say that i have this code`` (function($){ $.fn.extend({ //plugin name myPlugin : function(needed){ var defaults = { path : 'action.php', source : '' } var needed = $.extend(defaults,needed); //return return...

JQuery Height of Hidden TR returning 0...

Hey Guys, I'm trying to calculate the height of a TR that is set to display:none, however, the jquery height extension method returns 0 everytime. Of course when its visible it returns the correct value. From my understanding and past experience, I don't know why this is happening because shouldn't it return the height even if its hid...

How to best utilize jQuery to programmatically generate HTML elements

I have a bunch of Javascript functions that look like the following: function generateBusinessImage (business) { var business_image = document.createElement('img'); business_image.setAttribute('class','photo'); business_image.alt = business.name; business_image.title = business.name; business_image.align = 'right'; business_...

JQuery scrolling issue when submiting a form

I'm building an ASP.NET website and I'm puzzled with the behavior of one page, I've got a long form and a submit button, I've got the piece of javascript below in the page to handle scrolling the page back up upon submiting the form, the first time I click the submit button it works all the sequent clicks don't work at all, any idea why?...

Palm Pre frameworks

I have some measure of web development experience (not my main skill, but I am pretty good with the basics) What I'm sorely lacking is knowledge of and experience with modern JS frameworks (Prototype, jQuery, YUI, whatnot). I'd like to play with them (all eventually but need to start with one). Here's the problem: I'm very interested i...

JQuery UI Dialog + JQuery Validate + Tabbing

Hi I have a jquery ui dialog with a form inside. If I call the validate method of the jquery.validate plugin, tabbing inside the form fields strangely submits the form. If I remove the call to validate, the odd behaviour dissapears, but then I would have to validate by hand. Any ideas why? Can't post code right now, but could create...

Getting the original this in an object for jQuery event handlers etc. when using class inheritance

I know that jQuery isn't designed for working with a class-like model but I really could do with being able to extend a base class as that fits my needs perfectly. I started by just doing the following: jQuery.myBase = { foo: 'bar', bar: function() { ... } } jQuery.fn.myPlugin = function() { $.extend( this, jQuery.myBase, {...

jquery select multiple problem

<select name="garden" multiple="multiple"> <option>Flowers</option> <option selected="selected">Shrubs</option> <option>Trees</option> <option selected="selected">Bushes</option> <option>Grass</option> <option>Dirt</option> </select> $("select").change(function () { var str = ""; $("se...

ASP.Net ScriptManager - Is there a smaller version?

Hi, I use the ASP.Net ScriptManager to load the scripts needed for calling WCF services via HTTP/JSON. I am optimizing the total size of my pages (including scripts) and I see that Microsoft's AJAX library is the biggest file that I have at 96KB. Is there anyway that I can get a version of this file with just the features I need loaded...

jQuery: Watching for nodevalue change

I want to watch for the nodeValue change of an element that's edited with contenteditable. Basically, I want to run a function on change of the nodevalue. I found this post: http://james.padolsey.com/javascript/monitoring-dom-properties/ Which seems to have a plugin for what I want. Here's the watch plugin: jQuery.fn.watch = function...