Category Archives: jQuery

How to prevent parent’s onclick event from firing when a child tag is clicked with jquery?

Generally, Javascript events bubble (listen) to the highest point in the DOM to which a click event had been attached. So even if you don’t have any other explicitly click-able elements in the div, every child element of the div would bubble their click event up the DOM to until the DIV’s click event handler catches it. Continue reading

Adding multiple Recaptcha and custom form validation with Ajax

It is possible to add multiple Google Recaptcha on single page. Here is an example of adding Google Recaptcha in two different forms and adding custom validation to them. This example illustrates using how response ids are created when rendering of form and later using them to create custom validation on the time of submission of this form. Example uses jQuery to handle form submission events and the action of adding fields dynamically to forms where you don’t have an access to the building or rendering of the form. Continue reading

Vector Digital Clock jQuery Plugin (beta)

Vector Digital Clock jQuery Plugin (beta)

Vector Digital Clock jQuery Plugin (beta)

Vector Digital Clock plugin was created to show Digital Clock in more computerized and presentable way. With this plugin it is possible to show each digit or character of time in form of Digital Vector or character. This plugin works for different timezones and also takes care of the time differences arisen due to difference between your computer time and the server time. Continue reading

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.

		var text = $(this).val();
		if(text.length > 20) {
			text = text.substring(0, 20);