jquery

How to make everything in a textfield be capital letters / uppercase?

I want to make everything I write in a textfield to be capital letters. As I write, not after losing focus. How do I do this using jQuery? ...

radio button values not being submitted

I must be losing my mind... I have a form with some radio buttons, but no matter what, the POST is only including the NAME of the radios, not the value of whichever is selected: <input type="radio" name="storage" value="1" id="ds_d"> <input type="radio" name="storage" value="2" id="ds_p"> <input checked type="radio" name="s...

How to make a div element scroll to the top of the page

Assume that I have ten paragraphs of text and there is edit link next to each of paragraph. When I click on 'edit' the contents of the paragraph is available for editing. So I have <p id='p1'>data for p1</p> <p id='p2'>data for p2</p> <p id='p3'>data for p3</p> <p id='p4'>data for p4</p> If I click on 'edit' to edit p3 then text are...

jQuery - Scrub data in all textboxes/textareas in a form?

My buddy at work told me that you could use jQuery to write a few lines of code that would find a single character (in this example '\0') and replace it for all textboxes and textareas on the page. Of course, he didn't tell what lines of code would do that ... Is there a simple way to do this? We have a problem of people copying data ...

unbind hover inside a .everytime

Hi! Im having a issue within a hover that is inside a .everytime(2000)... j("#ifr").everyTime(2000,function(){... j.ajax({ url: "script.php", cache: true, success: function(html){ j(".chatline").hover(function(){ var did = j(this).attr('rel'); j("#status-"+did+":hidden").fadeIn('fast'); ...} the problem is that when .everytime fi...

How to use jQuery validate plugin to validate and not submit a form?

I have a set of elements on a page that where I would like to validate user input. However, the data in these elements is not to be submitted (no postback). Can I do this w/ the jQuery validate plugin? Do the elements have to be in a element anyway? Thanks ...

How to read json response as name value pairs in JQuery

I want to read json response as name and value pairs in my JQuery code. Here is my sample JSON response that I return from my java code: String jsonResponse = "{"name1":"value1", "name2:value2"}; in my JQuery, if I write jsonResponse.name1, I will get value as "value1". Here is my JQuery code $.ajax({ type: 'POST', dataType:'...

javascript click event question

Hi, I have a question below is a list with the anchor links now when the links are clicked I dont want the browser to go to that web page instead I want the browser to stay on the current page and display the list in an alert box to the user. I know this can be done with javascript maybe with the onclick event on the list item and displ...

Why jQuery hover gets stuck sometimes and how to fix it?

Sometimes when I hover on the elements the dropdown sucks and works vice versa, mostly when I'm already on the element and when the page starts to load, so you should test it with some reloads. Check out : Live Preview Video Screencast : Video Screencast Link The jQuery: $(function() { $("ul > li").hover(function() { $(th...

Show Sibling Divs One at a Time - jQuery

Hello, I have a set up of the following HTML <div class="container"> <div class="box">Content</div> <div class="box">Content</div> <div class="box">Content</div> <div class="box">Content</div> <div class="box">Content</div> </div> I would like to show one .box div at a time within the .container div. Fading in/out...

Input text box not editable with jQuery Draggable?

I call a javascript function that dynamically builds <li>'s with a text input box and drop down inside. The drop down works fine with jQuery's Draggable but I cannot edit the input text box? function addField(type){ var html = ''; html += '<li class="ui-state-default">'; if(type == 'text'){ html += '<b>Text Field</b><br />'; ...

Hide elements that are in an array | jQuery

Is it possible to hide elements that are in an array, e.g. var elements = ['.div-1', '.div-3']; With a structure of: <div id="wrap"> <div class="div-1"></div> <div class="div-2"></div> <div class="div-3"></div> </div> So div-2 should stay visible, while the elements that are in the array would be hidden by fadeOut. Is t...

jQuery tabs not working inside a thickbox

Hi! I´m working on a project, where i got a site with "case studies" and the details are show within a thickbox. Now, this content is split into 3 jQuery tabs, that work just fine in a blank page, but inside this thickbox, they don´t. <link rel="stylesheet" href="css/reset.css" type="text/css" media="screen" /> <link rel="stylesheet" h...

jQuery: How to bind an event for the div when it becomes visible?

I've got a div element: <div id="tab1"> Tab data </div>. How to bind a custom event when this div becomes visible (gets display: block;)? And also I'd like to bind an event when this div becomes invisible (gets display: none;). I'd like to do this in jQuery. Edit: I'm making simple tabs with ajax content. I want the content on ...

Multiple slidetoggle, one function

I want to show/hide menu options on my page and I'm using the slideToggle to do this (in a with an ID called Additions .. at the bottom of the example .. However I don't want to use multiple functions for every set of menu options, I'd like to simplify this as much as possible .. as it is now I have one function, but it only affects the...

How to use jQuery to prevent the space key from entering a space?

Hey there, I thought it would be a simple thing to hijack the space key when in a form input so that it would function like a hyphen. Generally jQuery makes stuff like this really simple. The code I tried is this: $("#StreamUrl").keydown(function (e) { if (e.keyCode == 32) return 109; }); But this has no ...

sort JSON by date

Hi, I know this must be relatively simple, but I have a dataset of JSON that I would like to sort by date. So far, I've run into problems at every turn. Right now I have the date stored as this.lastUpdated. I have access to jquery if that helps, but I realize the .sort() is native JS. Thanks in advance. ...

Hidden layer youtube video, on visible not loading IE7

hi, I have a html page. Which has few tabs (jquery). One of the hidden tab has youtube video. On the tab gets visible, the youtube video loads in IE8 and FF 3.6. But on IE7 it tries to load, but disappears. Please help me out to solve this problem. Thanks in advance. ...

An explanation of && shorthand in JavaScript.

Using a watermark plugin for jQuery, I'm attempting to jslint and minimize the functions but I've come across syntax I have never seen before wherein there are expressions where there really ought to be an assignment or function call: (function($) { $.fn.watermark = function(css, text) { return this.each(function() { ...

Can this code be optimized?

Hi, I am creating a page that allows users access to a certain section of my website if they click 8 out of 25 checkboxes in the right sequence. First of all thanks to Reigel for the code, its way better than what I initialy started with. My question is, can the javascript code I have be optimized. For instance, the clearforms function...