jquery

jQuery countdown status to show in button

I am using the following code to countdown before enabling a button. <script type="text/javascript"> $.fn.timedDisable = function(time) { if (time == null) { time = 5000; } return $(this).each(function() { $(this).attr('disabled', 'disabled'); var disabledElem = $(this); setTimeout(function() { ...

jquery, get id of dropdownlist when button is clicked.

My dom looks like: <td> <select id=s1 class=c1>...</select> <select id=s2 class=c1>...</select> <select id=s3 class=c1>...</select> <input type=button id=btn value=click/> </td> Now when the page loads, I do a $(".c1").hide(); and then based on other logic, make one of them visible. Now when the button is clicked, I want the ID of t...

Using Both jQuery And FormEncode To Validate Forms Without Repetition

I'm working on a Pylons-based web app. Because I am sane, I am using jQuery (and plugins) instead of writing raw JavaScript. I am also using FormEncode to validate forms for my app (especially new user registration). FormEncode is great for validating forms after they're submitted. jQuery, when JavaScript is available, validates form...

Using jQuery to block form redirections on submit until the function finishes

Is there a way, using jQuery, to force a form to wait until a function is done executing before submitting? I have a submit button on a multi-field form. I would like the submit button to hit a server to determine whether the current user has any items in the database, and if they have none, I would like it to pop up a confirmation wind...

jquery help selecting the parent

I have this HTML <li> <a rel="1" href="/jobwall/job/1"> <img src="http://lcl.moovjob.com/media/images/employers/simonainleydotinfo.jpg"&gt; </a> </li> and I have this javascript $('ul#jobs li a').mouseenter(function(){ $(this).parent().addClass('active'); $.ajax({ type: 'POST', url: '/jobwall/j...

Major IE8 positioning issues.

Hello. I know its a not a new concept that my site is perfect on FF,Safari and Chrome but jacked up on IE8. That being said and cutting to the chase. This is the home page that I am working on for a social network for people with CysticFibrosis. http://www.cysticlife.org/Home.php If you can, look at it in FF,Safari and Chrome, and the...

jscrollpane plugin seems to remove DIV from the DOM.

I've seen this same issue posted in this forum as well as others ... unfortunately none of the responses in those places has helped me. So I broach the subject yet again ... On my test site hompepage (http://www.crucean.com/testSite/index.html), I have a DIV with the ID #bodyText ... when jscrollpane is called on this DIV, it has an eff...

Jquery click function doesn't work on dynamic content.. Help please.

Hi, I'm new to jquery and am learning it. I was following these 2 tutorials and I couldn't find the solutions for what I am looking for: 1). spyrestudios.com/demos/jquerydemo2/ajax.html 2). web.enavu.com/demos/paginate2/ What I've done : 1). The sub-dynamic content which is data from the whole pagination html ( level 3 ) 1). The dyna...

jQuery delay vs. setTimeout for jackpot "spinner" image swapping

Scenario: I want to create a jQuery controllable jackpot "spinner" that will rapidly sequence a number of random images through a div before settling on one, with the delay interval between each equal but changeable. For mockup purposes, I'm simply changing CSS color classes to a box, although in the final I'll use background images. ...

Checking specific checkboxes based on select option using Jquery

I am trying to check checkboxes based on a select option. So, if the user chooses one option 3 from the dropdown, I want it to automatically check checkboxes with the ids set as 4, 24, and 17. I have predefined the variables using PHP, so that my array is as follows: var per =[]; per['3'] = []; per['3']['4'] = '4'; per['3']['24']...

Agnostic Javascript Framework Adapter for jQuery and Mootools?

Hey all, I'm about to port a series of my jQuery projects over to Vanilla Javascript (pure javascript, no framework) and would like to know if there are any existing [framework adapters / framework agnostic adapters] out there? For instance I'm envisioning something like this: // My Project (function(){ // Fetch all the elements u...

JavaScript pivot table

Are there any open source pivot tables with drag&drop support or what is the fastest method to implement it? Which JS library to use? I wanted JQuery, will this be the right solution? ...

Jquery: Stop propagation ?

I have added stopPropagation, however, I still get two popups in a row. This is better than before, where there were 20 popups for one element that is clicked....is there a better approach or am I missing something ? $(top.document).ready(function () { $("*").click(processAction); }); function processAction(e) { var clicked =...

Javascript and JQuery "this" scope errors

A sample bit of code: <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"&gt;&lt;/script&gt; <div id="myinfo">info</div> <input id="clickme" type="button" value="click here to display info"/> <script type="text/javascript"> function Fighter() { this.name = "Kenny"; // fight...

Javascript/jQuery - How do I obtain name of the class of clicked element?

I googled and googled and I concluded that it's very hard to get answer on my own. I am trying to use jquery or JavaScript to get a property of clicked element. I can use "this.hash" for example - it returns hash value I presume. Now I would like to get name of the class of clicked element. Is it even possible? How? And where would I...

jQuery Sortable - Select and Drag Multiple List Items

I have a design where I have a list of "available boxes", users take boxes by dragging them from the "available boxes" list to their "My Boxes" list. Users more often than not take multiple boxes at a time (max 20), once they have finished with the boxes they drag them back to the "available boxes" list to return them. jQuery sortable ...

Is it ever acceptable to have multiple IDs in a html page?

There's quite a few questions on Stack Overflow about id vs class but these questions are nearly always in relation to CSS - and the generally accepted answer is to use classes to style a particular set of elements, and ids for specific instances. Makes sense, fair enough. I'm finding however that as I do more and more Javascript/jQuer...

jquery: disable click function on ui dialog

$(top.document).ready(function () { $("*").click(processAction); function processAction(e){ var clicked = e.target; e.stopPropagation(); alert(clicked.tagName); e.stopPropagation(); switch(clicked.tagName) { case "A": newDialog("You've clicked on a link !", "Please Choose An Action <...

How to not open a new window (JavaScript popup) if jQuery validation plugin returns false? (ASP.NET)

Hi, I have an .aspx page with a couple of textfields. I validate these with jQuery validation plugin when the user clicks the submit button. When the submit button is clicked I also open up a new window, but I only want to open the window if the fields are correctly filled out. How do I stop the window from opening if the fields are no...

How to make element scroll with you on page?

I would like to create an element on a website that scrolls as you scroll down the window. In most cases, I know this could easily be solved with some basic css using fixed positioning. The issue is, I would not like it to be in the same space on the screen at all times. I would like it to be a sidebar element that starts with the rest o...