jquery

Odd results using jQuery rating plugin

Hi, I use a for loop to generate my stars. I want them split into four so I use class="star {split:4}" I want 5 stars, so I need 20 loops (4splits * 5stars = 20). When it hits 17, it echo's checked="checked" However, in the browser, my script displays 30 stars with 25 and a quarter stars highlighted! Here's my line in PHP <inp...

Convert absolute position to relative

Is it possible to change DIV position from absolute to relative (and from relative to absolute)? DIV should remain on same place. ...

Change form field options dynamically (and restore previously selected options) using jQuery

I'm fairly new to both jQuery and JavaScript so can anyone please point out what I'm missing here? I have a form with multiple pairs of select fields, where the content of the second field relies on the selection of the first one. Once a value is chosen from the first one then a piece of jQuery code empties the corresponding second sele...

Send form when hitting enter

I have a form in a jQuery enabled site. The form does not feature an <input type="submit"> button. For that reason, it's not submitted when you hit enter. What's the recommended way to emulate such behaviour? <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt; <html lang="en"> <head>...

jquery toggle to work in multiple instances

I have a show/hide effect that works but I just need to be able to use it multiple times in a page. Currently it toggles all elements. Can't get my head around how to do it. Hope you can help. http://pastebin.me/29328e556caf53e9a1925030d65b864b ...

jquery event to execute only when a particular event has finished

Hi, $('#div1').focus(function () { callAnotherFunction(); $(this).animate({}); } I'm trying to make $(this).animate({}); execute after callAnotherFunction(); has completed. Currently, both run at the same time. I've timed to use delay(), setTimeout() to no avail too. Is there anyway this can be done? Thanks! ...

jQuery load, can see the div in the source code but it is not being displayed

I'm using jQuery's load function to load an error message if an ajax request fails into a div. I can see the div with the loaded contents in my source code but it's not showing up on the page. Any idea what's going on? $(function() { $(".submit").click(function() { var element = $(this); var id = element.attr('id'); v...

jquery animation callback - how to pass parameters to callback

I´m building a jquery animation from a multidimensional array, and in the callback of each iteration i would like to use an element of the array. However somehow I always end up with last element of the array instead of all different elements. html: <div id="square" style="background-color: #33ff33; width: 100px; height: 100px; positi...

jquery html or innerHTML?

why i am unable to display the text in my dev box? <script type="text/javascript"> $(document).ready(function() { $("facebookUserBox").innerHTML("you have not loggged in...") }); var loggedIn = '<%=IsLoggedIn%>' if (loggedIn) { $("facebookUserBox").innerHTML("Logged in text"); } </scri...

jQuery: Dynamic image handling (waiting for load)

I'm trying to write a plugin that has a built in function to wait until all images that are on the page to be loaded before it executes itself. $(window).load() only works if it's the initial load of the page, but if someone wants to pull down some HTML through AJAX that contains images, it doesn't work. Is there any good way of doing t...

jquery click an img hide an LI

i have something similar to the following... used a python script to JSON to populate. <ul> <li id="p1" class="x">val1 <img id="ip1" class="redx" src="redx.gif"/></li> <li id="p2" class="x">val2 <img id="ip2" class="redx" src="redx.gif"/></li> <li id="p3" class="x">val3 <img id="ip3" class="redx" src="redx.gif"/></li> <li id="p4" class=...

jquery show hide replace area

how can i use jQuery to show/hide the same div area... essentially swapping out content? here is what i have so far, and i cant figure out how to hide the previous content and replace it with the new content: <script type="text/javascript"> $(document).ready(function(){ $('.content').hide(); $('a').click(function()...

jquery loop to create elements

Dear all, I have had no luck with this task so far so grateful for any help. I have an html form, in which there is a small select menu (1-10) ie <select> <option value = '1'>1</option> <option value = '2'>2</option> ... <option value = '10'>10</option> </select> depending on what value is selected i would like jquery...

jquery - how to get input text value from inside td

<tr> <td> <input type="text" name="desc[]"> </td> <td> <input type="text" name="duration[]"> </td> <td> <input type="text" name="start[]" class="start"> </td> <td> <input type="text" name="wait[]"> </td> <td> <input type="text" name="end[]"> </td> <td> <input type="text" name="phone[]"> <...

Jquery: Fade multiple elements one after the other

Hello, is there any possible solution, to fadeIn(500) multiple list elements one after the other? <ul id="list"> <li>test</li> <li>test</li> <li>test</li> <li>test</li> <li>test</li> </ul> Kind Regards, Werner ...

HTML Button's jQuery function is having trouble with MVC FileResult

I intended for this function to call my MVC action method that returns a CSV report. $(function() { $('#exportButton').click(function() { $.get('/curReport/GetCSVReport'); }); }); If I make a button like the code below then, when it is clicked, I'm given the "Open with/Save File" window. <input type="button" value="Ex...

Reading cookies across different hosts

I have two sites - both are my projects. On site two, I need to check if the user is logged in on site one. I suppose to do this I should just create a script that puts a cookie into the body of an iframe and then read the iframe contents on site two. But I can't. Here is a code I made for testing purposes: http://jsbin.com/oqaza/edit ...

Jquery validations on form with no fields

I have a table (in a form) populated with radio buttons (with a button for each value in a collection). If the collection is empty, nothing shows up in the table (which is fine). (I'm using Struts2) My trouble comes when validating that the user has selected one of these radio buttons when the submit button is clicked. I'm using JQUE...

Jquery getting list of values of hidden inputs within a div

I am trying to get a list of values within a div that I will format later using the .each() method. They are input values which are hidden my html and jquery call looks like this. <div id="container_0"> <input type="hidden" id="check_data" value=10> <input type="hidden" id="check_data" value=20> </div> Jquery: var list = $('#c...

jQuery: Self Executing Plugin?

I am working on expansion of my jQuery plug-in authoring knowledge, just playing around with my own ideas for learning benefits. So i was wondering how you guys tackle the need of plugin executing without any user specific input. So I have a need for plug-in that executes right away after document is ready, without any user's specific i...