Category archive

javascript

Post related to JAVASCRIPT

20 articles

HTML

Redirect to another page after a specific time interval

<html> <body> <h1>Welcome to my Website</h1> <h4 id=”msg”>You will be redirected to another page in 5 seconds!</h4> <script type=”text/javascript”> function countDown(i, callback) { callback = callback || function(){}; var int = setInterval(function() { //document.getElementById(“displayDiv”).innerHTML = “Number: ” + i

Jan 23, 2018

Read article

HTML

validate mobile number on keypress using jquery

How to validate and restrict unwanted character for mobile or phone number field using jquery $(document).ready(function () { $(‘#mobile’).keyup(function () { var $th = $(this); $th.val($th.val().replace(/[^0-9]/g, function (str) { return ”; })); }); });

Aug 8, 2015

Read article

javascript

validate name on keypress using jquery

How to validate and restrict unwanted character for name field using jquery $(document).ready(function () { $(‘#name’).keyup(function () { var $th = $(this); $th.val($th.val().replace(/[^a-zA-Z0-9 \`]/g, function (str) { return ”; })); }); });

Aug 8, 2015

Read article

HTML

How to fix flash object z-index

If any of your html element is getting hide behind the flash object such as youtube video player, or any flash player/object Then you should call this function on body load. function fix_flash_z_index() { // loop through every embed tag on the site var embeds = document.getElementsByTagName(’embed’); for (i = 0; i

Feb 26, 2012

Read article

javascript

check whether any of the checkbox are checked or not

function isChecked(url) { f=document.frmName var checkFound = false; for (var counter=0; counter < f.length; counter++) { if ((f.elements[counter].name == ‘checkBoxId[]’) && (f.elements[counter].checked == true)) { checkFound = true; } } if (checkFound != true) { alert(‘Please check at least one checkbox.’); return fal

May 4, 2009

Read article