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…
Category: Javascript
Javascript random integer between two numbers
A very simple and useful method to find a random integer between two numbers. Found this simple javascript function to calculate random integer between two numbers or intervals. Posting here for a quick reference. Here it is: [javascript]function randMaxMin(min,max) { return…
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.…
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…
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.
Object doesn’t support this property or method javascript error
In some browsers it would throw a “silent” error and stop executing javascript code. If you try to open page in IE in debug mode it would alert error message like this: Object doesn’t support this property or method
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…
Validating php multiple-value checkbox form element with javascript
In php a multiple-value form element such as checkbox is named suffixed with a set of square brackets. For example, My commonly used colors are: <form action=”index.php” name=”myform” method=”post” onsubmit=”return validate_form();”> <input type=”checkbox” name=”colors[]” value=”red” /> <input type=”checkbox” name=”colors[]” value=”green”…
Useful trim prototype (function) in core javascript
Below is the most commonly used trim prototype/function in javascript. Posting for reference. String.prototype.trim = function() { return this.replace(/(^\s*)|(\s*$)/g,””) } You can place the above code (wrapped in <script></script>) inside <header> section of your web page or you can place…
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: