Amazon Shop

Alphabets Validation in Javascript

>> Thursday, December 1, 2011

Demo
Your Name:
Step:1 Create Form Data
Your Name:
Next, Call the javascript code from head section or from external file like validation.js



Read more...

Javascript Image Validation

Image Validation using JavaScript.

function isValidImage(imagename)
{
 imagefile_value = imagename;
 var checking = imagefile_value.toLowerCase();
 if (!checking.match(/(\.jpg|\.gif|\.png|\.JPG|\.GIF|\.PNG|\.jpeg|\.JPEG)$/))
 {
  return false;
 }
 else
 {
  return true;
 }
}

Read more...

Onkeypress Javascript Numeric and Decimal Validation


Step : 1
Form Input Text Box:



Step : 2
Now place javascript validation code in the head or external javascript file like validation.js


function digits(obj, e, allowDecimal, allowNegative)
{
 var key;
 var isCtrl = false;
 var keychar;
 var reg;
  
 if(window.event) {
  key = e.keyCode;
  isCtrl = window.event.ctrlKey
 }
 else if(e.which) {
  key = e.which;
  isCtrl = e.ctrlKey;
 }
 
 if (isNaN(key)) return true;
 
 keychar = String.fromCharCode(key);
 
 // check for backspace or delete, or if Ctrl was pressed
 if (key == 8 || isCtrl)
 {
  return true;
 }

 reg = /\d/;
 var isFirstN = allowNegative ? keychar == '-' && obj.value.indexOf('-') == -1 : false;
 var isFirstD = allowDecimal ? keychar == '.' && obj.value.indexOf('.') == -1 : false;
 
 return isFirstN || isFirstD || reg.test(keychar);
}

Read more...

Email Validatation in Javascript

>> Saturday, April 17, 2010


Email :

Read more...

  © Blogger template Webnolia by Ourblogtemplates.com 2009

Back to TOP