Share on Google+Share on Google+

Java Coder
Registration page with JavaScript Validation
1 Answer(s)      4 years and 3 months ago
Posted in : JavaScript Questions

HTML Registration page with JavaScript Validation - required source code

Ads

View Answers

January 5, 2013 at 5:36 PM


Registration page in HTML with JavaScript Validation source code

<html>
    <head>
    <script language="javascript">
    function validateForm()
    {
    var a=document.forms["RForm"]["Lname"].value;
    if (a==null || a=="")
      {
      alert("please Enter Login Name ");
      return false;
      }
      var b=document.forms["RForm"]["Pass"].value;
    if (b==null || b=="")
      {
      alert("please Enter password");
      return false;
      }
       var c=document.forms["RForm"]["RPass"].value;
    if (c==null || c=="")
      {
      alert("please Enter Confirm password");
      return false;
      }
      if(b!=c){
        alert("PassWord Doesn't match..");
        return false;
      }

      var d=document.forms["RForm"]["Email"].value;
    if (d==null || d=="")
      {
      alert("please Enter Email");
      return false;
      }else{
        var mailformat = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
        if(d.match(mailformat))
        {
        document.RForm.Email.focus();
        //return true;
        }
        else
        {
        alert("You have entered an invalid email address!");
        document.RForm.Email.focus();
        return false;
        }
      }


      var f=document.forms["RForm"]["Gender"].value;
    if (f==null || f=="")
      {
      alert("please Enter Gender");
      return false;
      }
      var g=document.forms["RForm"]["Country"].value;
    if (g==null || g=="")
      {
      alert("please Enter Country");
      return false;
      }
      var h=document.forms["RForm"]["Adress"].value;
    if (h==null || h=="")
      {
      alert("please Enter Adress");
      return false;
      }
      var i=document.forms["RForm"]["Phone"].value;
    if (i==null || i=="")
      {
      alert("please Enter Phone No");
      return false;

      }

       if(isNaN(i)|| i.indexOf(" ")!=-1)
        {
                            alert("Enter numeric value");
                return false;
                    }
                     if (i.length >10)
                {
                                alert("enter 10 characters"); 
                    return false;
                         }
     }
    </script>
    </head>

    <body>

    <form method="post" name="RForm" onSubmit="return validateForm();">
    <table width="40%"  bgcolor="#efee82" align="center">

        <tr>        
            <td colspan=3 ><font size=3><center><b>REGSTRATION FORM</b></center></font>     
        </tr>

        <tr>
            <td width="30%">Login Name:<br/></td>
            <td><input name="Lname" type="text" size=25 maxlength=20></td>
        </tr>
        <tr>
            <td width="30%">Password:<br/></td>
            <td><input name="Pass" type="password" size=25 maxlength=20></td>
        </tr>
        <tr>
            <td width="30%">Confirm Password :<br/></td>
            <td><input name="RPass" type="password" size=25 maxlength=20></td>
        </tr>
        <tr>
            <td width="30%">Email :<br/></td>
            <td><input name="Email" type="text" size=25 maxlength=20></td>
        </tr>
        <tr>
            <td width="30" valign="middle">Gender:</td>
              <td><select name="Gender" onChange="";>
                  <option selected="selected" value="">---Select---</option>
                  <option value="AU_61">Male</option>
                  <option value="AU_61">Female</option>

                </select></td>
            </tr>
            <td width="30" valign="middle">Select Country :</td>
              <td><select name="Country" onChange="";>
                  <option selected="selected" value="">---Select---</option>
                  <option value="AU_61">India</option>
                  <option value="AU_61">Pakistan</option>
                  <option value="AU_61">Sri Lanka</option>
                  <option value="AU_61">Nepal</option>
                  <option value="AU_61">Bangladesh</option>
                  <option value="AU_61">China</option>          
                </select></td>
            </tr>
        <tr>
            <td width="30%">Adress:<br/></td>
            <td><textarea name="Adress"rows=3 colos=30></textarea></td>
        </tr>
        <tr>
            <td width="30%">Phone no:<br/></td>
            <td><input name="Phone" type="text" size=25 maxlength=10></td>
        </tr>
        <tr>
            <td ><input type="Reset">
            <td ><input type="submit" value="Submit">
        </tr>

    </table>
    </form>
    </body>
    </html>









Related Tutorials/Questions & Answers:
Registration page with JavaScript Validation
Registration page with JavaScript Validation   HTML Registration page with JavaScript Validation - required source code   Registration page in HTML with JavaScript Validation source code <html> <head>
javascript validation
javascript validation  validation of comparing dropdownlist and textbox in javascript
Advertisements
form registration on JavaScript
form registration on JavaScript   i want form of registration on JavaScript > < check the name is string or number & if the name number output error >> and the same of email and birthday and country >> <
JavaScript Email Validation
JavaScript Email Validation...; In this section we are going to check email Validation using JavaScript. JavaScript allows to perform a client side validation of email Ids in several forms
javascript validation
javascript validation  my problem is following code is my form i want validation and for email field it will check formate useing regularexpressions. <html> <script src="combovalidate1.js" type="text/javascript
javascript validation
javascript validation  How to do javascript validations to check whether the entered primary key is present in the database or not .Iam using jsp language
javascript validation
javascript validation  How to do javascript validations to check whether the entered primary key is present in the database or not .Iam using jsp language
JavaScript Form Validation
JavaScript Form Validation  JavaScript Form Validation
javascript validation
javascript validation  i have 4 buttons in my project like save,find,modify,clear and exit. Here my problem is i have to validate in javascript like if i click on save button an alert message should be displayed "DO YOU WANT
javascript validation
javascript validation  I need to validate password with following...;/script> <script language="javascript"> function...;<INPUT id=register type=button value=Submit name=Submit onclick='javascript
javascript for websites url validation
javascript for websites url validation  javascript for websites url validation   JavaScript Code for URL Validation **function isvalidurl(url) { return url.match(/^(ht|f)tps?:\/\/[a-z0-9-.]+.[a-z]{2,4}\/?([^\s<
how to create a login page and registration page?
how to create a login page and registration page?  hellow, pls tell me the code for how we can create a login page and registration page and how we can store the info in database.only in advance java as jsp
creating web page for form registration
creating web page for form registration  I am creating web page for form registration to my department ..I have to Reprint the Application Form (i.e Download the PDf File from the Database ) , when the user gives the Application
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)submit button All should display enter the field required(like name required
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)submit button All should display enter the field required(like name required
simple javascript validation for numbers
simple javascript validation for numbers  simple javascript validation for register number   Here is a html code that accepts number from...; <title>Mobile number validation using regex</title> <script
javascript regex validation alphanumeric
javascript regex validation alphanumeric  How to write javascript regex validation for alphanumeric?   <html> <head> <title> alphanumeric validation using regex</title> <script type="text
javascript regex validation email
javascript regex validation email  How to write JavaScript regex validation for email?   <html> <head> <title>Email validation using regex</title> <script type="text/javascript">
Alphanumeric Validation in JavaScript
Alphanumeric Validation in JavaScript In this tutorials we will discuss about alphanumeric validation in JavaScript. Sometimes it may occur when user have... box named registration number in which we have validated it using JavaScript
Validation probs in javascript
page if validation fails. Thanks s advance...Validation probs in javascript  This is my sports1.jsp file <%@page contentType="text/html" pageEncoding="UTF-8"%> <!DOCTYPE html>
Design a registration.jsp page with input for user registration details
Design a registration.jsp page with input for user registration details  Design a registration.jsp page with input for user registration details like... submitting this details, display the details onto the display.jsp page using
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...; <title>view</title> <script type="text/javascript
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...;title>view</title> <script type="text/javascript" >
Login page validation on ipad
Login page validation on ipad  I am using userId & password labels and their corresponding textfield. Now I want to validate the details by single sign in button and want to switch on to next page. Used two labels again
Javascript validation - Java Beginners
Javascript validation  Hi I have developed the following function for the validation of Zip code,the problem is, when user enters the valid zip code in first attempt, the background color of text box changes to green while I
web page for form registration to my department
web page for form registration to my department  I am creating web page for form registration to my department ..I have to Reprint the Application Form (i.e Download the PDf File from the Database ) , when the user gives
yyyy-mm-dd validation in javascript
yyyy-mm-dd validation in javascript   My form return value like (2011-10-05)yyyy-mm-dd ... my End date greater than my start date.. How to do validation in javascript
Form Validation with JavaScript
Form Validation with JavaScript  I created a simple form including nine or ten fields in HTML, and i want to validate it in JavaScript. How can i do it? Thanks!!   Hi Friend, Try the following code: 1)register.html
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
Javascript validation - Java Beginners
Javascript validation  Hi, this is ragav and my doubt is: I am having a input type="file" text box in which the user can browse the required... or not in javascript? plz urgent..   Hi Friend, Try the following code
code for user registration page and login page of emails using jsp
code for user registration page and login page of emails using jsp  hiiiiiii please send me the code for user registration page and login page of email using jsp and servlets and also code for database connectivity to oracle
Tutorials   
Java Spring Hibernate Struts Training code for programming How can I dynamically load user-entered data as content of jquery dialog? java webcam integration question java coding Fix Scrollbar position in a checkboxList after postback Information Save Alert Country wise redirection to files Interface in javascript connect database with javascript Zip Code ZipCode how to validate the email login How to play FLV video files on Ipad using HTML code or javascript code? Nitobi Grid is not working in IE10/IE11 jquery issue plese help RegEx Tree structure from json whose parents can be dragged and dropped from child newyorklife insurance getElementById not working javascript code for search in html file Implement The Skeleton Code Implement This Skeleton Code Mobile Automation using Appium Computer forensic application Java: Searching a string from doc files java linked list urgent !!! java linked list urgent!!! library management library management library management library management question Html form using JavaScript to display the table content java how to prevent no from unroundin off on clicking text box again in JSP and Jquery graph generation from xml design file display data from database in textbox when id entered in textbox Javascript Code for all fields how to get HTTP GET request value using javascript array Javascript Querry autocomplete(): Spring mvc with jquery: I am not getting correct value in the text filed. Please help me Create SpreadSheet same as excel using java applet Create SpreadSheet same as excel using java applet How to change focus among multiple select boxes? Write JQUERY Code Write JQUERY Code Converting jsp variable to java variable java

Ads

 
Advertisement null

Ads