jquery

What is the correct syntax to return div without an id using jQuery?

I'm using jQuery 1.3.1 and when I try to loop through a form and remove any div w/out an id i get an exception. uncaught exception: Syntax error, unrecognized expression: [@id] $('form:eq(1)').children().each( function() { this2 = this; if ($(this2).find('div').not('[@id]')) { $(this).remove(); }...

Is it possible, and what is the simplest way, to wrap events in jQuery

Background I would like to simulate the "active" behavior that most browsers support for links when they are clicked. For any element and event I would like to be able to add a css class to the element for the duration of the event. So in psuedo jQuery code I'd like to do this: $(".button").click(function() { alert('clicked'); }); ......

highlighting gridview rows for striped gridview from checkbox

Within the gridview I have, I'm trying to make it so when the user checks a check box for the row the row is highlighted. Now, this GridView is striped (meaning even rows have one background color and odd rows have another). This code to do it is floating around the net in various forms... var color = ''; function changeColor(obj) { ...

<select> ajax calls

Hey, I am using jQuery on my site and i have a update section on my project and I have three dropdowns: Completed? Hours Worked Who worked on this project? I am trying to create an ajax call using jQuery to when I select it, call a $.ajax() and send the data to my php page to update my mysql database. I am guessing I could do this:...

Is jQuery always the answer?

I've come across a couple questions, such as this one, and I really have to wonder why "Use jQuery" seems to be the answer when somebody asks how to do something in JavaScript. I understand that jQuery can save you a lot of time, and can help you out a lot, especially when you are doing a lot of fancy JavaScript in your site. However, ...

Get all hrefs as an array in jQuery

My code looks like this: <ul id="ulList"> <li class="listClass" id="id1"><a href="http://link1"&gt;Link 1</a></li> <li class="listClass" id="id2"><a href="http://link2"&gt;Link 2</a></li> <li class="listClass" id="id3"><a href="http://link3"&gt;Link 3</a></li> </ul> Now I like to get the following: All links as an array All id...

jQuery UI slide effect on mouseenter

I've been at this for a couple of days now, so any help would be much appreciated. I've got a link which contains two divs sitting on top of each other. The top div is hidden, but slides in to partially cover the bottom div on mouseenter, and then out again on mouseleave. It is working to a degree, but is a bit buggy. This is what I have...

Best Practices - set jQuery property from Code-Behind

I need to set a single property in a jQuery command using a value that is calculated in the code-behind. My initial thought was to just use <%= %> to access it like this: .aspx <script type="text/javascript" language="javascript"> $('.sparklines').sparkline('html', { fillColor: 'transparent', normalRangeMin: '0', normalRang...

jQuery: how to select every cell in a table except the last in each row?

I want every cell in each row except the last in each row. I tried: $("table tr td:not(:last)") but that seems to have given me every cell except the very last in the table. Not quite what I want. I'm sure this is simple but I'm still wrapping my head around the selectors. ...

JQuery Click event not being triggered in Safari?

I'm trying to do something when a user selects an option from a select box - As simple as can be right? I'm using JQuery 1.3.1 to register a click handler with the id of the select box. Everything was fine until I tested using Chrome and Safari and found it didn't work. Firefox 3.05 - YES I.E 7.0.5730.13 - YES IE6Eolas - YES Sarafi 3...

What could possibly cause JQuery's selector to break?

I am trying to get an element using JQuery's selector, but it does not find it even though the element actually exists. Moreover, I can actually find the element using getElementById. For example: $('#outputDiv') gives me a null value. But document.getElementById("outputDiv") returns me the Div I was trying to access. Any idea? ...

Best way to implement save field in DataGrid when user tabs out or field looses focus

I have a page with .Net grid view with about 12 text fields per row and about 250 rows. Right now there is a save all button at the bottom of the page that sends all the fields 12x250 to the server where they are entered into db 1 by one. Which ends up being very slow and some times does not go through at all. I didnt come up with this ...

Getting custom tooltips with JQuery

Hello, I'm looking for a JQuery code sample or library for displaying tooltips when the cursor hovers over an element. Specifically, what I want to do is display my own <div> element on hover, not an automatically-constructed or loaded-from-the-host-element tooltip. I've looked at a couple JQuery tooltip plugins and they all seem to be ...

How do you compare a value from jQuery with a fixed number?

How do you compare a value from jQuery with a fixed number? I thought this might work but it doesn't: if (parseInt($("#days").value) > 7) { alert("more than one week"); } ...

In JQuery is there way for slideDown() method to scroll the page down too?

The slideDown applied to a div does the slideDown but doesn't scroll the page down and the div slided down div remains hidden from view. Is there a way to scroll the page down as well so the user can view the div? ...

Jquery Live Validation

Hello Everyone, After having a search around I could not find exactly what I want, I am looking to validate a form client side using the Jquery library and some form of validation plugin. I was hoping that some one could advise me on whether there are any validation plugins out there that do not use generic error messages, as my form ...

Why does this jQuery work differently after I move to a different page then hit the back button?

I'm making a simple navigation menu for a site. You create an ul with id menu, and should be pretty simple from there. I have some simple css to give all the lis the correct background image, then some jQuery to change the look of an li when the user mouses over. It works pretty well, but there's one problem. When the user clicks on ...

Can an asterisk in the text cause a getJSON request to not work?

This is really strange but this code is working fine unless the value entered by the user includes an asterik (*) or other characters like $ or #. The #ticketNumber.Val() is the suspected problem. Some of our id's have an * in them. Any help would be appreciated. function buttonClicks() { var action = '/ServiceCall/IsAServiceCall...

jquery question concerning selectors and $(this)

Ok this is a general question about how to solve this issue, not to find some work around for the example given. Lets say I have a $(this) object and it is a select, if I want to select the selected option and I had an id I could just bust a $('#id option:selected') game over. but with a this I can't go $(this+' option:selected') or ...

jQuery- Call function when textarea wraps to a new line?

I'd like to increase the height of a textarea when the text wraps to a new line, so it dynamically expands to whatever it needs to be. I don't want to use the onscroll event because I want the expansion to always be one step ahead of the scrolling, so the textarea never scrolls until it reaches a max height of x. Anyway I could do this?...