Archive for "jQuery"

Dec
03
How to check radio button on page load with jQuery

For example you have a set of radio buttons created dynamically with some web language like PHP and you expected one of them selected or checked on most of the times. If, none of them was checked somehow, you would want jQuery to get one of checked on page load. Here’s the quick solution to this condition. Click to continue »

Tags : ,

Nov
23
jQuery way to limit input characters using javascript substring function

It’s an example of useful jQuery way to limit user entering a maximum set number of character in your input fields. Example makes use of javascript substring function to limit user upto 20 character which is triggered on keyup event. It truncate anything extra to that limit.

$("input[name=Title]").keyup(function(){
		var text = $(this).val();
		if(text.length > 20) {
			text = text.substring(0, 20);
			$(this).val(text);
		}
	})

Sep
30
Sum of values in input fields grouped by class attribute using jQeury

Here is the jQuery way to calculate the sum of all values stored in input fields grouped by class “.subtotal”. In this example the sum will be shown as an alert as soon as you leave a field after entering some numeric value in it Click to continue »

Tags : , , ,

Jun
08
Fix to jQuery ui calendar not appearing from or hiding behind thickbox

If you are facing an issue of jQuery ui calendar not appearing while clicked from a jQuery thickbox or if some part of the calendar hiding behind the thickbox window you need to apply a quick fix to your calendar. Click to continue »

Tags : , , ,

Jun
08
A possible reason for jQuery thickbox appearing twice on a click

I had an issue while using thickbox with jQuery today. The thickbox which i had been using to show ajax content opened twice. It appeared like one single window/thickbox but it stretched down the page making bottom border go out of sight. I debugged it with firebug and in html source i found that Click to continue »

Tags : , ,

Apr
12
jQuery pop up message box sliding from left to right and positioning horizontally at the center

Just wrote a simple sliding box script to make a message box appear sliding from left to the middle of web page. The box appears once a day. The first appearance is logged into a browser cookie, so if user opens the same website and if cookie was expired it appears again. Click to continue »

Tags : , , ,

Jan
04
A simple javascript image slide show using setTimeout and jQuery

Just now i created a small slideshow. The slideshow uses some static images stored in a javascript object (array) and runs till the last image in this array. For example, the array: Click to continue »

Tags : , , , , , ,

Sep
29
Form DOM element not recognized (created) in ajax form in IE when placed with end tag missing

Skipping a form end tag </form> costed me almost a day (i had to go to bed abandoning the fixing for some time though;)). I had been using ajaxForm with jQuery to submit ajax form which was placed on a popup dialog box opened through ajax. The form worked well in Mozilla Firefox, Google Chrome, Safari but did not work in Internet Explorer 7 & 8 (IE7 & IE8 ; i didn’t test in other versions of IE but perhaps they would not work either). The IE simply would not create the <form> tag at all so if you try to alert $(“#formID”).length it would return always 0(zero). It started to work fine (in IE) when i placed </form> to mark the end of the form (i know it was a mistake to not to place it there though). Click to continue »

Tags : , , , , , , ,

Aug
20
Fix to jQuery plugin does not work on ajax loaded content

I had been loading table records through ajax pagination using jquery. Some of the urls/links (View Details, Edit and Delete) in loaded content had been using thickbox to handle respective requests. Although, if i did’t use the ajax to load records these links would work fine and thickbox would open. But once i introduced ajax they suddenly stopped working. Click to continue »

Tags : , , , ,

Jun
05
Creating Ajax form in Cakephp using jQuery

Because of its being more flexible, extensible and precise nature the jQuery certainly has emerged as a more popular Javascript library as compared to prototype library. If you plan your Cakephp application depend heavily on Javascript, its right time to chose jQuery for your cakephp-cum-javascript needs. Click to continue »

Tags : , ,

Freelance Jobs