Welcome to Scribd. Sign in or start your free trial to enjoy unlimited e-books, audiobooks & documents.Find out more
Download
Standard view
Full view
of .
Look up keyword
Like this
17Activity
0 of .
Results for:
No results containing your search query
P. 1
Javascript Validation (Commonly Used)

Javascript Validation (Commonly Used)

Ratings:

5.0

(1)
|Views: 98|Likes:
Published by Sunil Soni
JavaScript Validation
JavaScript Validation

More info:

Categories:Types, Reviews, Book
Published by: Sunil Soni on Sep 23, 2011
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as DOCX, PDF, TXT or read online from Scribd
See more
See less

04/26/2013

pdf

text

original

 
 Page 1
 
DocumentVersionModification CommentsModifiedByReviewedByDate Comments
Draft 1.0 Created the documentSunil Soni- 11-09-2011
Contents
.
 
 3.2. JavaScript Code 2 ....................................................................................................................... 114. Radio Button Validation .................................................................................................................... 124.1. getCheckedValue(): ................................................................................................................... 124.2. setCheckedValue():.................................................................................................................... 134.3. isCheckedRadio: ........................................................................................................................ 135. Checking for all Numbers: ................................................................................................................. 146. Checking for all Letters: ..................................................................................................................... 157. Checking for all Numbers and Letters: .............................................................................................. 168. Restricting the Length: ...................................................................................................................... 16Example: ................................................................................................................................................ 169. Remove Special Characters from string: ........................................................................................... 1710. Username Validation: .................................................................................................................... 1710.1. ....................................................................................................................................................... 1711. Password Validation: .................................................................................................................... 1812. Phone Number Validation: ........................................................................................................... 1912.1. Validation 1: .......................................................................................................................... 1912.2. Validation 2: .......................................................................................................................... 1913. Dropdown Validation: .................................................................................................................. 2014. Links: .............................................................................................................................................. 20Dynamic JavaScript Form Validation ......................................................................................................... 20
 
 Page 3
 
1.
 
Introduction
It is often a good idea to put your common JavaScript validation functions into acommon file, so you can include the file from all pages which need the formvalidation
.
2.
 
Date Validation
2.1.
 
FromDate toDate
This is the code for date comparison fromDate should be less than toDate
var objFromDate = document.getElementById("fromdate").value;var objToDate = document.getElementById("todate").value;var FromDate = new Date(objFromDate);var ToDate = new Date(objToDate);var valCurDate = new Date();val CurDate = valCurDate.getMonth()+1 + "/" + valCurDate.getDate() + "/" + valCurDate.getYear();var CurDate = new Date(valCurDate);if(FromDate > ToDate){alert(fromname + " should be less than " + toname);return false;}else if(FromDate > CurDate){alert("From date should be less than current date");return false;}else if(ToDate > CurDate)

Activity (17)

You've already reviewed this. Edit your review.
1 hundred reads
vitu3075 liked this
sareeee liked this
teenu jung liked this
ALi liked this
Sunil Soni liked this
ALi liked this
ALi liked this
Sunil Soni liked this
Sunil Soni liked this

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->