Zip Code Validation

Zip Code Validation

View Answers

November 27, 2008 at 11:32 PM

Hi friend,

Code for Validate Zip code of 6 digits using Javascript.

<script language="javascript" type="text/javascript">
function validateZIP() {
if(document.zipForm.zip.value!="")
{

if(document.zipForm.zip.value.length!=6)
{
alert("Please enter zip code of 6 digit.");
document.zipForm.zip.focus();
return false;
}
else if(isNaN(document.zipForm.zip.value))
{
alert("Please enter valid digit 0-9.");
document.zipForm.zip.focus();
return false;
}

return true ;

}
}


</script>
<form name="zipForm" onSubmit="return validateZIP();">
Zip: <input type=text size=30 name=zip>
<input type=submit value="Submit">
</form>


For more information,Examples and Tutorials on Javscript visit to :

http://www.roseindia.net/javascript/

Thanks

November 27, 2008 at 11:54 PM

Date Validation (From and To)

Html code :

<form name="cashForm" method="post" action="viewTransaction.jsp" onsubmit="return validate();">
<table width="350px" align="center" border=0 style="background-color:ffeeff">
<tr>
<td colspan=2 align="center" style="font-weight:bold;font-size:20pt;">View Transaction</td>

</tr>
<tr>
<td colspan=2>&nbsp;</td>

</tr>



<tr>
<td>Start Date</td>
<td><input type="sdate" name="sdate" id="sdate"><a href="javascript:NewCal('sdate','mmddyyyy')"><img src="cal.gif" width="16" height="16" border="0" alt="Pick a date"></a></td>
</tr>

<tr>
<td>End Date</td>
<td><input type="edate" name="edate" id="edate"><a href="javascript:NewCal('edate','mmddyyyy')"><img src="cal.gif" width="16" height="16" border="0" alt="Pick a date"></a></td>
</tr>

<tr>
<td></td>
<td><input type="submit" name="Submit" value="Submit"></td>
</tr>

---------------
Javascript code :

<script language="JavaScript">
<!--
if (document.images)
{
calimg= new Image(16,16);
calimg.src="images/cal.gif";
}
function validate()
{
var fromDate = "2008-11-28";
var toDate = "2008-11-27";


var sdate = fromDate.split("-");
//alert(sdate.length);
var edate = toDate.split("-");
//alert(edate.length);
if(sdate[0]>edate[0])
{
alert("Start date not greater then end Date.");
document.cashForm.edate.focus();
return false;
}
else if(sdate[1]>edate[1])
{
alert("Start date not greater then end Date.");
document.cashForm.edate.focus();
return false;
}
else if(sdate[2]>edate[2])
{
alert("Start date not greater then end Date.");
document.cashForm.edate.focus();
return false;
}
//return false;

}
//-->
</script>

Thanks









Related Tutorials/Questions & Answers:
Zip Code Validation - Java Interview Questions
Zip Code Validation  Hi, Anyone can please send me a javascript function of the following --> Indian postal Zip Code Validation (Only 6 digits... should not be greater than to date  Hi friend, Code for Validate Zip
Zip Code
Zip Code   I have 4 excel file and i want to zip that files also i need password protect when i open that file please write that code for local machine also write in using javascript
Advertisements
ModuleNotFoundError: No module named 'django-zip-code-api'
ModuleNotFoundError: No module named 'django-zip-code-api'  Hi, My... named 'django-zip-code-api' How to remove the ModuleNotFoundError: No module named 'django-zip-code-api' error? Thanks   Hi
ModuleNotFoundError: No module named 'zip-code-radius'
ModuleNotFoundError: No module named 'zip-code-radius'  Hi, My... named 'zip-code-radius' How to remove the ModuleNotFoundError: No module named 'zip-code-radius' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'django-zip-code-api'
ModuleNotFoundError: No module named 'django-zip-code-api'  Hi, My... named 'django-zip-code-api' How to remove the ModuleNotFoundError: No module named 'django-zip-code-api' error? Thanks   Hi
Encode 5 digit zip code - Java Beginners
Encode 5 digit zip code  I have an assignment to read in a 5 digit zip code, sum the digits, and come up with the check digit. I then need... as well as a | at the beginning and a | at the end. For example, the zip code 95014
Javascript validation code
Javascript validation code  Hi, I need a javascript validation code for the following fields 1)Name 2)Email 3)Mobile 4)City 5)State 6)Product type 7...,email required etc) Kindly please send me the code as soon as possible
Javascript validation code
Javascript validation code  Hi, I need a javascript validation code for the following fields 1)Name 2)Email 3)Mobile 4)City 5)State 6)Product type 7.....it should display enter the field required Kindly please send me the code
How to generate hash code of Zip file.
How to generate hash code of Zip file. In this tutorial, we will see how to generate hash code of zip file entries. The ZipFile   class is used to read... of entries of zip file.  code import java.io.*; import 
Matching Zip code using regular expression
Matching Zip code using regular expression  ...;45643-44435"):-Defining Zip code which is to be matched with the regular... code is :45643 regex for the Zip code is : \d{5}(-\d{4
Validation code - Java Interview Questions
Validation code  Hi, Anyone can please send me a javascript function for password filed validation (the field will only take characters as input not other). Thanx in advance  Hi friend, code to solve the problem
combox validation javascript code - JSP-Servlet
combox validation javascript code  hiiiiiii, I want a javascript code for combobox field validation for my Lotus Notes web page.... thnx  Hi This is the source code of combobox validation in javascript
Email Validation code - Java Interview Questions
Email Validation code  Can anybody tell me how to write email validation code using java   Hi Friend, Please visit the following link: http://www.roseindia.net/tutorial/java/core/regularExpressions.html Thanks
JavaScript regex validate validate Zip.
- how to validate Zip?   <html> <head> <title>Zip Code...)) { alert("Your Zip Code : "+zip); return true; } alert("It is not valid zip code !"); return false; } <
schedule zip
schedule zip  Java Code to automatically get and zip only .txt files from folders for every 5 days and also to send the zip files to database tables
Please provide jquery inline form validation for the code
Please provide jquery inline form validation for the code   <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Student Form</title> <script type
Two Dates code validation - Date Calendar
Two Dates code validation  Hi Sir.I am using calender for two text... should be greater than date of birth.plz help me in code .  Hi Friend, Try the following code: function check(objName) { var datefield
How to make a zip file in java
zip file. Code: import java.io.*; import java.util.zip....Description: In this example we will discuss about how to create zip file from...;} } Output: When you compile and run this program it will create the zip
Listing Contents of a ZIP File
of a zip file through the java code. Following program helps you for the appropriate.... This class is used to read the zip file entries.ADS_TO_REPLACE_2 Here is the code... Listing Contents of a ZIP File     
validation
validation  we are doing payroll system project in java.So pls provide the complete validation code for employee master form
validation
validation  validation
how to write a code for oracle database connection in asp.net for validation.
how to write a code for oracle database connection in asp.net for validation.  <script language="javascript" type="text/javascript"> function fill() { //<%@ import Namespace="System.Data" %> //<%@ import
please send me javascript validation code - Java Beginners
please send me javascript validation code  hallo sir , please send me java script code for this html page.since i want to do validation.i am a new user in java ....please send me its urgent
validation.....
validation.....  hi.......... thanks for ur reply for validation code. but i want a very simple code in java swings where user is allowed to enter only numerical values in textbox , if he enters string values then it should
validation
it goes to another folder.) this is my code i used this method... Validation method valid the in put. otherwise call the javascript onsubmit to check... code.Ok if you use struts then you can use Validation method valid the in put
validation
validation  please help me to check validation for <form> <table class="form"> <tr> <td class...; in this code i have to get error when sno,date,custmername,contactno
ModuleNotFoundError: No module named 'zip'
ModuleNotFoundError: No module named 'zip'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'zip' How to remove the ModuleNotFoundError: No module named 'zip' error
Read a zip file.
zip_entry_read() In this example the function zip_entry_read() will help in reading a zip file. First select a file to be opened. Name that file into zip file and direct the zipread command to read it through while loop. The zip_entry
Validation
); JLabel label=new JLabel("JTable validation Example",JLabel.CENTER); JPanel panel=new JPanel(); panel.add(scroll); JFrame frame=new JFrame("JTable validation
Java file zip
(); zos.close(); } } By using the above code, you can create a zip file...Java file zip In this section, you will learn how to create a zip file. The ZIP file format is used for the distribution and storage of files
zip file upload in php - WebSevices
zip file upload in php  This is not a normal upload. we know the code for normal upload. i need the zip file upload code in php. how to upload zipfile using php? and how to unzip using php? please i dont
validation
validation  when user enter course to follow,should have pre requirements. This is my code if(document.application1.courseCode1.value ==1) { frmvalidator.addValidation("subject1","shouldselchk=biology","Should
Validation
Validation  Here is my form and what code should i write for validating it? - <form action="test4.jsp"> <ul> <b>User ID</b> :<input type="text" name="userid">
Validation
Validation  Here is my form and what code should i write for validating it? - <form action="test4.jsp"> <ul> <b>User ID</b> :<input type="text" name="userid">
sending a zip file to servlet
sending a zip file to servlet  I have created a .zip file in a servlet on the local system(no static ip). The .zip file contains xml files. I have to send it to another servlet which is in a server(has a static ip). I have done
Artifacts of org.elasticsearch.distribution.integ-test-zip
List of Artifacts of org.elasticsearch.distribution.integ-test-zip maven depenency
please check my code is wrong or ok.it was not work .this is form validation in javascript using jsf page
please check my code is wrong or ok.it was not work .this is form validation in javascript using jsf page  <p>?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN
Struts Login Validation. In This code setter of login page is called only one time again it doesnt call it. Why..?
Struts Login Validation. In This code setter of login page is called only one time again it doesnt call it. Why..?  **struts.xml** <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE struts PUBLIC "-//Apache Software
please check my code is wrong or ok.it was not work .this is form validation in javascript using jsf page
Form validation in javascript using jsf page  ?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html
How to create a zip file and how to compare zip size with normal text file
How to create a zip file and how to compare zip size with normal text file  Hi, how are you?I hope you are fine.I want program like how to create zip file based on one text file.i saw the code in the below link which was provided
Create a new zip file in ZipArchive.
Creating a new Zip file in ZipArchive For creating zip file, use zipArchive () class. Create a new zip file in ZipArchive. Use the conditional statement... will generate a new zip file, in case of failure, it will print failed in creating
How to zip a file using javascrip?
How to zip a file using javascrip?  hi.. can anyone tell me How to zip a file using javascrip
convert zip file to byte array
convert zip file to byte array  Hi,How to convert zip file to byte array,can you please provide program?? Thanks, Ramanuja
Creating a ZIP file in Java
Creating a ZIP file in Java       Zip File: Zip file format is the popular method of data compression. Zip file contains many files in compressed format. You can
ModuleNotFoundError: No module named 'dict-zip'
ModuleNotFoundError: No module named 'dict-zip'  Hi, My Python... 'dict-zip' How to remove the ModuleNotFoundError: No module named 'dict-zip... to install padas library. You can install dict-zip python with following
ModuleNotFoundError: No module named 'extract-zip'
ModuleNotFoundError: No module named 'extract-zip'  Hi, My Python... 'extract-zip' How to remove the ModuleNotFoundError: No module named 'extract-zip' error? Thanks   Hi, In your python environment
ModuleNotFoundError: No module named 'odoo10-addon-l10n-br-zip'
ModuleNotFoundError: No module named 'odoo10-addon-l10n-br-zip'  Hi...: No module named 'odoo10-addon-l10n-br-zip' How to remove the ModuleNotFoundError: No module named 'odoo10-addon-l10n-br-zip' error? Thanks  
ModuleNotFoundError: No module named 'odoo10-addon-l10n-br-zip'
ModuleNotFoundError: No module named 'odoo10-addon-l10n-br-zip'  Hi...: No module named 'odoo10-addon-l10n-br-zip' How to remove the ModuleNotFoundError: No module named 'odoo10-addon-l10n-br-zip' error? Thanks  
ModuleNotFoundError: No module named 'odoo10-addon-l10n-ch-zip'
ModuleNotFoundError: No module named 'odoo10-addon-l10n-ch-zip'  Hi...: No module named 'odoo10-addon-l10n-ch-zip' How to remove the ModuleNotFoundError: No module named 'odoo10-addon-l10n-ch-zip' error? Thanks  
ModuleNotFoundError: No module named 'odoo11-addon-l10n-ch-zip'
ModuleNotFoundError: No module named 'odoo11-addon-l10n-ch-zip'  Hi...: No module named 'odoo11-addon-l10n-ch-zip' How to remove the ModuleNotFoundError: No module named 'odoo11-addon-l10n-ch-zip' error? Thanks  

Ads