jquery

How can I pass variables from JavaScript to PHP?

I am using jQuery to calculate prices. Here is a small snippet of my JavaScript: // Prices: radio var curLam = "gloss"; $("input[name=lamination]").click(function(){ var gloss = 5; var matt = 6; if ($(this).val() == 'gloss' && curLam != 'gloss'){ $('#prices span').text(parseInt($('#prices span').text()) + gloss - matt); curLam = ...

Jquery $().each method obscures 'this' keyword

I am creating a Javascript object that contains a function that executes a jQuery each method like the following: function MyClass { Method1 = function(obj) { // Does something here } Method2 = function() { $(".SomeClass").each(function() { // 1 2 this.Method1(this); }); } } Which objec...

jquery and IE Rendering issue

I realise that IE is a bit rubbish at most things but I was hoping someone could come up with a way of fixing a display issue in IE when using jquery. on the following site, I have used jquery on the menu to show and hide options (projects and contact) http://www.isabelarbelaez.com When these are clicked in IE, they show whatever is ...

jquery selector strangeness -- is this a bug or am I doing it wrong?

I'm getting inconsistant results across browsers with the following test: ============ test.html =========== <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"&gt; <html lang="en"> <head> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"...

jQuery - fade item in/out whilst retaining flow layout

I have a list of items in my web application; each of these has a set of command buttons arrayed beneath it. To keep the interface clean, these buttons only show up when you hover over the item. The buttons are wrapped in a tag which has the following CSS attribute: visibility: hidden This preserves the layout - so that the list items ...

Dependent select forms

Hi everyone, I'm trying to create a dependent select form like this one on AjaxRay. Here's what I've done so far: http://buzzmedia.com.my/honda/form.html Unlike the example from AjaxRay, my form has multiple rows. I need to figure out how to adapt the code from the AjaxRay example for my own form. ...

jQuery Forms - Ajax and normal submit the same form

Hello, I have a confirm step in one of my pages. Desired action: user clicks 'submit' and an AJAX request is made that does the appropriate action and returns a confirm dialog user 'confirms' and then the form is submitted using a standard post. So for the first part I'm fine using the jQuery form plugin: $('form').ajaxForm(...opt...

Using jqGrid userdata

I have a jqGrid on an ASP.Net MVC view. I want to use to pass the value of a hidden text control on the page as an additional parameter to a jqGrid method. I have the following hidden text field: <div> <%= Html.Hidden("contactId", Model.ContactId) %> </div> and I want to do something like: userdata: {contactId : jQuery('#contactId')...

MySQL's LIKE in JQuery

I'd like to filter several SPANs with the text they contain: $('spanFilter').filter(function(){ var html = $(this).html(); return //comparison html LIKE %asdf% }); In the comparison, I'm trying to do something like MySQL's LIKE: field LIKE %asdf% How can I achieve that? ...

How is jQuery documentation generated

I am looking at the source code of jQuery in subversion . What I would like to know is how jQuery docuemtation is generated since I do not see any documentation in the source code. Unlike Java/Ruby there is no documentation done when a method is defined. So where is the repository for the jQuery documentation in the svn ? I personally u...

how to get value of a div in jQuery

I have this sample code but why is messageA always null? var test = "<div id='message2'>My Message 2</div>" var $response1 = $('<div/>').html(test); var messageA = $('#message1', $response1).html(); alert ('message: ' + messageA); it should come back as 'My Message 2' ...

jQuery validate() function.

I have a credit application form. If there is a co-applicant, I want to run the same validation for the primary applicant. Currently, I have: $().ready(function() { $("#cApp").validate({ rules: { ... }, messages: { ... } }); $('#coApp').click(function() { var coAppVal = $('input[name=coApp]').val(); if (coApp == 1) { $('#...

When using jQuery and Fade is there a way to prevent the surrounding content from "jumping" downwards?

I'd really love the surrounding content to "scroll" up/down in like when using Scroll - but would also love the appropriate div to "fade" in. ...

why is '<' showing as &lt;

I am outputting a string form my java class like this String numQsAdded = "<div id='message1'>"+getQuestion()+"</div>"; This string is being sent back to the client side as a XMLHttpRequest. So, in my jsp page I have a javascript alert method that prints out the string returned from the server. it translates '<' to &lt; and '>' to &g...

JQuery Change() function IE problem

Hi, I've got an asp.net formview control and I want the Update/Cancel buttons to be disabled until the user makes a change and I've tried using jquery to do this. The following code works in FireFox, and works in IE when the form is opened in insert mode. However, if the form is opened in edit mode (in IE), therefore getting populated w...

Using jQuery to get the next or previous element from a selection

How can I get the previous or next element from a jQuery selection? Basically, I will have a set of elements, say all inputs: $('input') When I have a single input, I also need to get the previous and next input. Something like: $(this).prev('input') $(this).next('input') However, the inputs are not siblings and I don't want just ...

JQuery - Validate() and grouping similar form items

I have the following form: http://fuzzysiberians.com/app4.cfm when there is no social security number, my error message is being displayed after each text field. Is there a way to group these error messages so that there will be 3 text boxes next to each other and then display only one error message? ...

How is callback with arguments executed?

Hi I got acquainted with jQuery a few days back and am beginning to realize the little magic it can do. I am curious to know how exactly a callback with arguments is executed in jQuery i.e. what is the exact execution sequence? I went through the link http://docs.jquery.com/Tutorials:How_jQuery_Works and it speaks of a wrong way i.e....

Show all children in Superfish jquery menu

I'm using the Superfish jquery menu system and have a requirement to show all children regardless of level. The menu only shows the children of the selected item. Perhaps someone can help me figure how to modify the code to make it work this way. Superfish menu HTML example of a node: <li class="root"><a href="#" title="Training" cl...

JQuery - Set Background Image to Image object

Hello, I new to JQuery and I am trying to do a proof-of-concept with it. I am trying to use JQuery to: 1) Download a large (>500kb) image file 2) Set the image as the background of an element when downloaded 3) fade it in (basically the way that Bing.com does it). The StackOverflow community has generously helped me most of the way thro...