Sunday, March 18, 2012

Validate the registration, user login, user profile and payment by credit card pages using JavaScript


 Validate the registration, user login, user profile and payment by credit card pages using JavaScript.

REGISTRATION FORM

<Html>
<Head>
<Title>User Registration Form</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" fptype="dynamicanimation">
</script>
</head>
<body>
<script language="javascript">
function verify(form)
{
if(document.forms[0].elements[0].value=="")
{
alert("Please Enter User ID");
document.forms[0].elements[0].focus();
return(false);
}
if(document.forms[0].elements[1].value=="")
{
alert("Please Enter your Password");
document.forms[0].elements[2].value="";
document.forms[0].elements[1].focus();
return(false);
}
if(document.forms[0].elements[1].value.length<4)
{
alert("Password must be greater than 4 character");
document.forms[0].elements[1].value="";
document.forms[0].elements[2].value="";
document.forms[0].elements[1].focus();
return(false);
}
if(document.forms[0].elements[2].value=="")
{
alert("Please Enter your Confirm Password");
document.forms[0].elements[2].focus();
return(false);
}
if((document.forms[0].elements[1].length)!=(document.forms[0].elements[2].length))
{
alert("Your Password does not match with Confirm Password");
document.forms[0].elements[1].value="";
document.forms[0].elements[2].value="";
document.forms[0].elements[1].focus();
return(false);
}


if((document.forms[0].elements[1].length)==(document.forms[0].elements[2].length))
{
if((document.forms[0].elements[1].value)!=(document.forms[0].elements[2].value))
{
alert("Your Password does not match with Confirm Password");
document.forms[0].elements[1].value="";
document.forms[0].elements[2].value="";
document.forms[0].elements[1].focus();
return(false);
}
}
if(document.forms[0].elements[3].value=="secq")
{
alert("Please Select your Security Question");
document.forms[0].elements[3].focus();
return(false);
}
if(document.forms[0].elements[4].value=="")
{
alert("Please Answer the security question");
document.forms[0].elements[4].focus();
return(false);
}
if(document.forms[0].elements[5].value=="DD")
{
alert("Please select Day of DOB");
document.forms[0].elements[5].focus();
return(false);
}
if(document.forms[0].elements[6].value=="MM")
{
alert("Please select Month of DOB");
document.forms[0].elements[6].focus();
return(false);
}
if(document.forms[0].elements[7].value=="YYYY")
{
alert("Please select Year of DOB");
document.forms[0].elements[7].focus();
return(false);
}
if(document.forms[0].elements[10].checked==true)
{
if(document.forms[0].elements[11].value=="")
{
alert("Please Enter your First Name");
document.forms[0].elements[11].focus();
return(false);
}
if(document.forms[0].elements[13].value=="")
{
alert("Please Enter your Last Name");
document.forms[0].elements[13].focus();
return(false);
}
if(document.forms[0].elements[14].value=="Year")
{
alert("Please specify your Academic year");
document.forms[0].elements[14].focus();
return(false);
}
if(document.forms[0].elements[15].value=="adminyear")
{
alert("Please put your Admission Year");
document.forms[0].elements[15].focus();
return(false);
}
if(document.forms[0].elements[16].value=="dept")
{
alert("Please Select your Department");
document.forms[0].elements[16].focus();
return(false);
}
if(document.forms[0].elements[17].value=="")
{
alert("Please put your Roll Number");
document.forms[0].elements[17].focus();
return(false);
}
if(document.forms[0].elements[17].value!="")
{
r0=document.forms[0].elements[17].value.indexOf('2');
r1=document.forms[0].elements[17].value.indexOf('k');
r2=parseInt(document.forms[0].elements[17].value.charAt(2));
r3=document.forms[0].elements[17].value.indexOf('_');
r4=parseInt(document.forms[0].elements[17].value.charAt(4));
r5=parseInt(document.forms[0].elements[17].value.charAt(5));
r6=parseInt(document.forms[0].elements[17].value.charAt(6));
len=document.forms[0].elements[17].value.length;
if((len!=7)||(r0!=0)||(r1!=1)||(r3!=3)||(r4>6 || r4<1)||(r2>9 || r2<1))
{
alert("Not a valid Roll Number");
document.forms[0].elements[17].focus();
return(false)
}
switch(document.forms[0].elements[16].value)
{
case 'IT':
if(r4!=6||(r5>4||r5<0)||(r6>9||r6<0))
{
alert("Not a valid Roll Number of Information Technology");
document.forms[0].elements[16].focus();
return(false)
}break;
case 'CSE':
if(r4!=5||(r5>4||r5<0)||(r6>9||r6<0))
{
alert("Not a valid Roll Number of Computer Science");
document.forms[0].elements[16].focus();
return(false)
}break;
case 'ECE':
if(r4!=4||(r5>4||r5<0)||(r6>9||r6<0))
{
alert("Not a valid Roll Number of Electronics");
document.forms[0].elements[16].focus();
return(false)
}break;
case 'EE':
if(r4!=2||(r5>6||r5<0)||(r6>9||r6<0))
{
alert("Not a valid Roll Number of Electrical Engineering");
document.forms[0].elements[16].focus();
return(false)
}break;
case 'ME':
if(r4!=3||(r5>6||r5<0)||(r6>9||r6<0))
{
alert("Not a valid Roll Number of Mechanical Engineering");
document.forms[0].elements[16].focus();
return(false)
}break;
case 'CE':
if(r4!=1||(r5>6||r5<0)||(r6>9||r6<0))
{
alert("Not a valid Roll Number of Civil Engineering");
document.forms[0].elements[16].focus();
return(false)
}break;
}
switch(document.forms[0].elements[14].value)
{
case 'Fourth':
if(r2!=1||(r2>9||r2<0))
{
alert("Not a valid Roll Number of Forth Year");
document.forms[0].elements[14].focus();
return(false)
}break;
case 'Third':
if(r2!=2||(r2>9||r2<0))
{
alert("Not a valid Roll Number of Third Year");
document.forms[0].elements[14].focus();
return(false)
}break;
case 'Second':
if(r2!=3||(r2>9||r2<0))
{
alert("Not a valid Roll Second Year");
document.forms[0].elements[14].focus();
return(false)
}break;

case 'First':
if(r2!=4||(r2>9||r2<0))
{
alert("Not a valid Roll Number of First Year");
document.forms[0].elements[14].focus();
return(false)
}break;
}
}
}
if(document.forms[0].elements[24].checked==true)
{
if(document.forms[0].elements[25].value=="")
{
alert("Please Enter Your First Name");
document.forms[0].elements[25].focus();
return(false);
}
if(document.forms[0].elements[27].value=="")
{
alert("Please Enter your Last Name");
document.forms[0].elements[27].focus();
return(false);
}
if(document.forms[0].elements[30].value=="state")
{
alert("Please Select Your State");
document.forms[0].elements[30].focus();
return(false);
}
if(document.forms[0].elements[31].value=="country")
{
alert("Please Select Your State");
document.forms[0].elements[31].focus();
return(false);
}
if((document.forms[0].elements[32].value=="pincode")||(document.forms[0].elements[33].value=""))
{
alert("Please Select Your Pincode OR if Other specify");
document.forms[0].elements[32].focus();
return(false);
}
}
}
function studentclear(form)
{
document.forms[0].elements[11].value="";
document.forms[0].elements[12].value="";
document.forms[0].elements[13].value="";
document.forms[0].elements[14].value="Year";
document.forms[0].elements[15].value="adminyear";
document.forms[0].elements[16].value="dept";
document.forms[0].elements[17].value="";
document.forms[0].elements[18].value="selecthostel";
document.forms[0].elements[19].value="";
document.forms[0].elements[20].value="";
document.forms[0].elements[21].value="";
document.forms[0].elements[22].value="";
document.forms[0].elements[23].value="";
document.forms[0].elements[25].focus();
}
function generalclear(form)
{
document.forms[0].elements[25].value="";
document.forms[0].elements[26].value="";
document.forms[0].elements[27].value="";
document.forms[0].elements[28].value="City";
document.forms[0].elements[29].value="";
document.forms[0].elements[30].value="state";
document.forms[0].elements[31].value="country";
document.forms[0].elements[32].value="pincode";
document.forms[0].elements[33].value="";
document.forms[0].elements[34].value="";
document.forms[0].elements[35].value="";
document.forms[0].elements[36].value="";
document.forms[0].elements[37].value="";
document.forms[0].elements[11].focus();
}
</script>
<body onLoad=document. forms [0].elements[0].focus();>
<form action ="" method="post" onsubmit="return verify(this.form)">
<center>
<p dynamicanimation="fpAnimelasticRightFP1" id="fpAnimelasticRightFP1"
style="position: relative !important; visibility: hidden" language="Javascript1.2">
<font size="6" face="Monotype Corsiva" color="#800000">New User Registration Form</font></p>
</center><br>
<i><font color="#FF0000"><font face="Arial" size="4">*</font>
<font face="Arial" size="2"></font> </font>
<font face="Arial" size="2"color="#FF0000">Indicates all the fields are mandatory</font></i><hr><p>
<font size="4" face="Arial, Helvetica, sans-serif" color="#FF0000">*</font>
<font size="-1" face="Arial, Helvetica,sans-serif">User ID:</font><b>
<input name="uid" size="16" maxlength="15"></b>
<font color="#FF0033" size="2"> </font>
<font face="Arial" size="2" color="#FF0033">
(Contains only letters (a-z), numbers (0-9) and underscore)</font>
<br><b><br></b>
<font size="4" face="Arial, Helvetica, sans-serif" color="#FF0000">*</font>
<font size="-1" face="Arial, Helvetica,sans-serif">Password: </font>
<font color="#000000"> </font>
<input type="password" name="pswd" size="9" maxlength="10" style="font-weight: bold; color:#008000">
<font color="#000000"size="2"><font face="Arial"> </font></font>
<font color="#FF0033" size="2" face="Arial">
(Password should be of minimum 4(four) and maximum 10(ten) characters. </font>
<font size="2"><font color="#FF0033" face="Arial">) </font></p>
</font> <font face="ARIAL, HELVETICA" size="-1"> </font>
<font size="4" face="Arial, Helvetica, sans-serif" color="#FF0000">*</font>
<font face="ARIAL, HELVETICA" size="-1">Re-Type Password</font>:<font size="2"> <b>
<input type="password" name="cpswd" size="11" maxlength="10" style="color:#008000" ></b> </font>
<hr><font size="2"> </font><font size="2">
<font face="Arial, Helvetica, sans-serif">
<i>If you forget your password, you can retrieve it by answering your unique hint question. <br>
Frame your question such that only you know its answer.
</i></font></font>
<div align="center"><font face="Arial" size="2"></font>
<font face="Arial" size="2"></font><font face="Arial" size="2"></font>
<font face="Arial" size="2"></font></div>
<font face="Arial" size="2"><br></font>
<font size="2"><font face="Arial">
<font face="Arial,Helvetica, sans-serif"></font></font></font>
<font size="4" face="Arial, Helvetica, sans-serif" color="#FF0000">*</font>
<font size="2"><font face="Arial">
<font face="Arial, Helvetica,sans-serif">
Select a question forgetting password </font><b>: </b></font>
<select size="1" name="secq">
<option selected value="secq">Select a hit question ?</option>
<option value="What is your favourite multimedia software?">
What is your favourite multimedia software?</option>
<option value="What is your favourite game?">What is your favourite game?</option>
<option value="who is your favourite Cricketer?">
who is your favourite Cricketer? </option>
<option value="who is your favourite Film Actor?">
who is your favourite Film Actor?</option>
<option value="what is your favourite food?">what is your favourite food?</option>
</select><font face="Arial"><b>
</b></font></font><p><font size="2">
</font><font size="4" face="Arial, Helvetica, sans-serif" color="#FF0000">*</font>
<font color="#000000" face="Arial, Helvetica, sans-serif" size="2">Hit Answer:
<input type="text" name="seca" size="21"> </font>
<font size="2"><font color="#000000" face="Arial, Helvetica,sans-serif"> </font>
<font color="#FF0033" face="Arial">(Write Your Answer)</font>
<font color="#000000" face="Arial"> </font>
</font><font size="1"></p></font>
<hr><div align="left"><font face="Arial,Helvetica, sans-serif" size="-1">
DD MM YYYY <br>
</font>
<font size="4" face="Arial, Helvetica, sans-serif"color="#FF0000">*</font>
<font face="Arial, Helvetica, sans-serif" size="-1">Date of Birth:
<select size="1" name="DD">
<option selected value="DD">Day</option> <option value="1">1</option>
<option value="2">2</option> <option value="3">3</option>
<option value="4">4</option> <option value="5">5</option>
<option value="6">6</option> <option value="7">7</option>
<option value="8">8</option> <option value="9">9</option>
<option value="10">10</option> <option value="11">11</option>
<option value="12">12</option> <option value="13">13</option>
<option value="14">14</option> <option value="15">15</option>
<option value="16">16</option> <option value="17">17</option>
<option value="18">18</option> <option value="19">19</option>
<option value="20">20</option> <option value="21">21</option>
<option value="22">22</option> <option value="23">23</option>
<option value="24">24</option> <option value="25">25</option>
<option value="26">26</option> <option value="27">27</option>
<option value="28">28</option> <option value="29">29</option>
<option value="30">30</option> <option value="31">31</option>
</select>
<select size="1" name="MM">
<option selected value="MM">Month</option><option value="JANUARY">JAN</option>
<option value="FEBRUARY">FEB</option> <option value="MARCH">MAR</option>
<option value="APRIL">APR</option> <option value="MAY">MAY</option>
<option value="JUNE">JUN</option> <option value="JULY">JUL</option>
<option value="AUGUST">AUG</option> <option value="SEPTEMBER">SEP</option>
<option value="OCTOBER">OCT</option><option value="NOVEMBER">NOV</option>
<option value="DECEMBER">DEC</option>
</select>
<select size="1" name="YYYY">
<option selected value="YYYY">Year</option> <option value="1970">1970</option> <option value="1971">1971</option> <option value="1972">1972</option> <option value="1973">1973</option> <option value="1974">1974</option> <option value="1975">1975</option> <option value="1976">1976</option> <option value="1977">1977</option> <option value="1978">1978</option> <option value="1979">1979</option> <option value="1980">1980</option> <option value="1981">1981</option> <option value="1982">1982</option> <option value="1983">1983</option> <option value="1984">1984</option> <option value="1985">1985</option> <option value="1986">1986</option> <option value="1987">1987</option> <option value="1988">1988</option> <option value="1989">1989</option> <option value="1990">1990</option> <option value="1991">1991</option> <option value="1992">1992</option> <option value="1993">1993</option> <option value="1994">1994</option> <option value="1995">1995</option> <option value="1996">1996</option> <option value="1996">1996</option> <option value="1997">1997</option> <option value="1998">1998</option> <option value="1999">1999</option> <option value="2000">2000</option> <option value="2001">2001</option> <option value="2002">2002</option> <option value="2003">2003</option> <option value="2004">2004</option> <option value="2005">2005</option> <option value="2006">2006</option> <option value="2007">2007</option> <option value="2008">2008</option> <option value="2009">2009</option> <option value="2010">2010</option> <option value="2011">2011</option> <option value="2012">2012</option> <option value="2013">2013</option> <option value="2014">2014</option> <option value="2015">2015</option> <option value="2016">2016</option> <option value="2017">2017</option> <option value="2018">2018</option> <option value="2019">2019</option> <option value="2020">2020</option> </select></font></div>
<p><font face="Arial, Helvetica, sans-serif" size="-1"></font>
<font size="4" face="Arial, Helvetica, sans-serif" color="#FF0000">*</font>

<font face="Arial, Helvetica, sans-serif" size="-1">
Gender:
<input type="radio" name="Male" value="male" checked> Male
<INPUT type=radio value="female" name="Male" >Female
</font>
<hr><font size="4" face="Arial, Helvetica, sans-serif" color="#FF0000"> </font>
<p> <font face="Arial, Helvetica, sans-serif" size="-1">
Contact No: <input type="text" size="6" name="std" maxlength="6"><b> -</b>
<input type="text" size="9" name="phno" maxlength="9">
</font><p>
<font face="Arial, Helvetica, sans-serif" size="-1">
Mobile No: <input type="text" size="18" name="mobno" maxlength="15"></font><p> <font face="Arial, Helvetica, sans-serif" size="-1">
Email:<input type="text" name="email" size="20">
</font><p><hr>
<div align="left"><font face="Arial, Helvetica, sans-serif" size="-1">
</font> </div><center>
<input type="submit" value="Submit" name="Submit" tabindex="25">
<input type="reset" value="Reset" name="Reset" tabindex="26">
</center></form></body></html>

output:

[IMG]http://i29.tinypic.com/2dsitqq.jpg[/IMG]

No comments:

Post a Comment

Slider

Image Slider By engineerportal.blogspot.in The slide is a linking image  Welcome to Engineer Portal... #htmlcaption

Tamil Short Film Laptaap

Tamil Short Film Laptaap
Laptapp

Labels

About Blogging (1) Advance Data Structure (2) ADVANCED COMPUTER ARCHITECTURE (4) Advanced Database (4) ADVANCED DATABASE TECHNOLOGY (4) ADVANCED JAVA PROGRAMMING (1) ADVANCED OPERATING SYSTEMS (3) ADVANCED OPERATING SYSTEMS LAB (2) Agriculture and Technology (1) Analag and Digital Communication (1) Android (1) Applet (1) ARTIFICIAL INTELLIGENCE (3) aspiration 2020 (3) assignment cse (12) AT (1) AT - key (1) Attacker World (6) Basic Electrical Engineering (1) C (1) C Aptitude (20) C Program (88) C# AND .NET FRAMEWORK (11) C++ (1) Calculator (1) Chemistry (1) Cloud Computing Lab (1) Compiler Design (8) Computer Graphics Lab (31) COMPUTER GRAPHICS LABORATORY (1) COMPUTER GRAPHICS Theory (1) COMPUTER NETWORKS (3) computer organisation and architecture (1) Course Plan (2) Cricket (1) cryptography and network security (3) CS 810 (2) cse syllabus (29) Cyberoam (1) Data Mining Techniques (5) Data structures (3) DATA WAREHOUSING AND DATA MINING (4) DATABASE MANAGEMENT SYSTEMS (8) DBMS Lab (11) Design and Analysis Algorithm CS 41 (1) Design and Management of Computer Networks (2) Development in Transportation (1) Digital Principles and System Design (1) Digital Signal Processing (15) DISCRETE MATHEMATICS (1) dos box (1) Download (1) ebooks (12) electronic circuits and electron devices (1) Embedded Software Development (4) Embedded systems lab (4) Embedded systems theory (1) Engineer Portal (1) ENGINEERING ECONOMICS AND FINANCIAL ACCOUNTING (5) ENGINEERING PHYSICS (1) english lab (7) Entertainment (1) Facebook (2) fact (31) FUNDAMENTALS OF COMPUTING AND PROGRAMMING (3) Gate (3) General (3) Global warming (1) GRAPH THEORY (1) Grid Computing (11) hacking (4) HIGH SPEED NETWORKS (1) Horizon (1) III year (1) INFORMATION SECURITY (1) Installation (1) INTELLECTUAL PROPERTY RIGHTS (IPR) (1) Internal Test (13) internet programming lab (20) IPL (1) Java (38) java lab (1) Java Programs (28) jdbc (1) jsp (1) KNOWLEDGE MANAGEMENT (1) lab syllabus (4) MATHEMATICS (3) Mechanical Engineering (1) Microprocessor and Microcontroller (1) Microprocessor and Microcontroller lab (11) Mini Projects (1) MOBILE AND PERVASIVE COMPUTING (15) MOBILE COMPUTING (1) Multicore Architecute (1) MULTICORE PROGRAMMING (2) Multiprocessor Programming (2) NANOTECHNOLOGY (1) NATURAL LANGUAGE PROCESSING (1) NETWORK PROGRAMMING AND MANAGEMENT (1) NETWORKPROGNMGMNT (1) networks lab (16) News (14) Nova (1) NUMERICAL METHODS (2) Object Oriented Programming (1) ooad lab (6) ooad theory (9) OPEN SOURCE LAB (22) openGL (10) Openstack (1) Operating System CS45 (2) operating systems lab (20) other (4) parallel computing (1) parallel processing (1) PARALLEL PROGRAMMING (1) Parallel Programming Paradigms (4) pdf (1) Perl (1) Placement (3) Placement - Interview Questions (64) PRINCIPLES OF COMMUNICATION (1) PROBABILITY AND QUEUING THEORY (3) PROGRAMMING PARADIGMS (1) Python (3) Question Bank (1) question of the day (8) Question Paper (13) Question Paper and Answer Key (3) Railway Airport and Harbor (1) REAL TIME SYSTEMS (1) RESOURCE MANAGEMENT TECHNIQUES (1) results (3) semester 4 (5) semester 5 (1) Semester 6 (5) SERVICE ORIENTED ARCHITECTURE (1) Skill Test (1) software (1) Software Engineering (4) SOFTWARE TESTING (1) Structural Analysis (1) syllabus (34) SYSTEM SOFTWARE (1) system software lab (2) SYSTEMS MODELING AND SIMULATION (1) Tansat (2) Tansat 2011 (1) Tansat 2013 (1) TCP/IP DESIGN AND IMPLEMENTATION (1) TECHNICAL ENGLISH (7) Technology and National Security (1) Theory of Computation (3) Thought for the Day (1) Timetable (4) tips (4) Topic Notes (7) tot (1) TOTAL QUALITY MANAGEMENT (4) tutorial (8) Ubuntu LTS 12.04 (1) Unit Wise Notes (1) University Question Paper (1) UNIX INTERNALS (1) UNIX Lab (21) USER INTERFACE DESIGN (3) VIDEO TUTORIALS (1) Virtual Instrumentation Lab (1) Visual Programming (2) Web Technology (11) WIRELESS NETWORKS (1)

LinkWithin