jquery

jQuery Validation Plugin

I really was trying to avoid asking this question. I have seen quite a few posts on SO regarding this plugin but they still didn't quite get it for me. Right now I have a new account registration form and I'm trying to write a custom method for validating a unique username. I would like to think that the following should work: $.validat...

what is the difference between $("#context .searched") and $(".searched",$("#context"))?

I had that question in mind for a long time. Theoretically, jQuery core function accepts an optional value that can be a DOM element - $(".searched",$("#context")[0]) - or a jQuery object - $(".searched",$("#context") ) . I discovered that last question reading that fine article. But i really cant see the difference between use a cont...

have any mistake with my last-child selector?

$(function(){ $("#mainContainer #container:last-child").css("background-image","url('/images/content-title.png') no-repeat") }) code above didn't work , nothing happend $(function(){ $("#mainContainer #container:last-child").css("background-image","url('/images/content-title.png')") }) code above work , but it change all the #...

Minifying Prototype introduces an error?

Hello all, I have made use of several web based minifiers that have worked for me in the past. I have just tried minifying a prototype version 1.6.0.1 - I have placed the original here and the minified here. The error I get from firebug after the js file being minified is this: missing } after property list ept': 'text/javascript,text...

How do i bind the "contextmenu"(it is a Plugin for the Context menu) to every first td in every row

iam having the table with id "someTable" where i have the rows dynamically from PHP i want to apply the contextmenu to every first td in every row .iam using the context menu plugin from here (http://www.trendskitchens.co.nz/jquery/contextmenu/) $("someTable td").contextmenu('mymenu')(function (){ //would the above state...

how to get the text of selected checkbox from asp.net checkboxlist control using jquery

I have asp.net checkboxlist control that bounded to a data source so the number of items in the control are different from one to to another time. I have this function: $('#<%=chkListGroups.ClientID %> input:checkbox:checked').siblings('label').text(); this function will return all texts for all selected items in the control as a o...

Jquery insert new row into table at a certain index

I know how to append or prepend a new row into a table using jquery: $('#my_table > tbody:last').append(html); How to I insert the row (given in the html variable) into a specific "row index" i. So if i=3, for instance, the row will be inserted as the 4th row in the table. ...

How to join two jQuery element objects? .add() isn't working...

Hi all, I'm inside a function and I need to return a jQuery object with two elements. Inside the function I have, for example: function getInput() { $hiddenInput = $('<input type="hidden">'); //(other code) $select = $('<select></select>'); //(other code) $hiddenInput.add($select); return $hiddenInput; } And ou...

Tradeoffs with client vs server side postback handling

I have a ListView that contains a large collection of rows with textboxes that users can optionally fill out. These textboxes are not databound. When the user clicks "next" i need to iterate over the rows and determine which fields the user has filled out, and then update a sort of "cart" with the data and move to a confirmation page (...

how to make the 'animate' run the opposite direction using jquery .

this is my code: $('#map_canvas').animate({width:'69.8%'},300); this will run from left to right , how to make it from right to left ? thanks ...

Why won't my Javascript functions work?

Hi guys, I'm trying to edit this JQuery code to work with a PHP, but for some reason, the javascript is not working properly. This is the javascript: function sel(x){ $(this).stop().animate({height:x},{queue:false, duration:600, easing: 'easeOutBounce'}) } function desel(){ $(this).stop().animate({height:'50px'},{queue:false, d...

lint warning that val() and text() are called incorrectly

I have: TotalPrice = parseInt(TotalPrice*100)/100; $('input[name=EstimatedPrice]').val(TotalPrice); $('#EstimatedPriceDisplay').text(TotalPrice); and I'm getting two warnings from lint. val() called incorrectly text() called incorrectly. I was able to eliminate the text() called incorrectly error by doing the following: $('#Es...

Filter JQuery Method By Compatibility

I am patching JQuery to work against svgweb. svgweb implements the SVG DOM in Flash for IE, and marshal's Flash calls via fake DOM nodes. Needless to say, JQuery doesn't work with svgweb. So, I'm patching select methods in JQuery, like (attr, hasClass, css, etc...) to work with svgweb. Is there a way to test JQuery method calls against ...

if ANY $_POST equals another $_POST die('error'); ???

I am trying to get this form to: if any $_POST vars equals any other of the $_POST vars throw an error. if it was just a few it wouldnt be an issue but I have about 20 or so so if i wanted to do it I would have to go like <?php if($_POST['input1']==$_POST['input2'] || $_POST['input1']==$_POST['input3']){ die('whatever'); } ...

jQuery returning the number (eq) of a clicked div

So I'm building a jQuery plugin for a project that allows the client to create multiple jQuery scrollers per page -- I'm focusing strictly on the front end for this question. On document ready, it will tell the slider div to initialize. This then takes the number of images in the slider, and creates a little circle button for each image...

Is it possible to load an image with JQuery and specify Accept HTTP header?

I'm trying to load an image with JQuery like so: function loadImage( path ) { var img = new Image(); $(img) .error(function () { alert('Error loading image'); }) .attr('src', path ); } I'm wondering if I am able to change the Accept HTTP header before the image is loaded because the API for the images requires it. ...

How to make a 'cancel' button not trigger the forms validation?

How to make a 'cancel' button not trigger the forms validation? I'm using asp.net MVC with the jquery validation plugin. ...

jQuery 1.4.2 postnot working the same way as in 1.3.2

Hey, I have just updated to 1.4.2 and now everything that has worked before does not. And I cant figure out why. var data = { 'what': 'post', 'type': $(this).attr('class'), 'id': $(this).next('input').val() } $.post( '/utils/ajax/', data, function(response) { alert(response.result); }, 'json' ); It...

How to print the value of text box dynamically

hi, I have text box called "userInput" and one submit button.I want to print the value of the text box which is entered by user like a stack(previous values also,not just the current value). any idea..?? <input type="text" name="userInput"/> <input type="button" name="sub" value="submit"> Thank in advance! ...

Calling javascript via AS3 externalinterface within a colorbox

I have a swf that opens up inside a colorbox window. When the video finishes playing, I make an externalinterface call to a javascript function to close the colorbox. I'm trying to execute the following AS3 code: ExternalInterface.call('parent.$.fn.colorbox.close()') I can't seem to get this to work. The colorbox won't close. I also ...