Share on Google+Share on Google+

RAJA MANICKAM
how to validate e,ail id and phne number in student form
1 Answer(s)      6 years and 4 months ago
Posted in : JavaScript Questions

how to validate e,ail id and phne number in student form

Ads

View Answers

December 16, 2010 at 1:34 PM


Hi Friend,

Try the following code:

<html>
<script>

function validate(){

var ph=document.getElementById('phone').value;
var e=document.getElementById('email').value;
var regExpObj = /(\d\d\d)-\d\d\d\d\d\d\d\d/;
var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
   var e = document.getElementById('email').value;
   if(reg.test(e) == false) {
      alert('Invalid Email Address');
      document.getElementById('email').value="";
      return false;
   }
else if(ph==""){
alert("Enter Phone Number!");
}
 else if(regExpObj.exec(ph) == null){
        alert('Invalid Phone Number!');
        return false;
    } else {
     return true;
    }
}
</script>
<form id="form" method="post"  onsubmit="javascript:return validate();">
<table>
<tr><td>Email </td><td><input type="text" id="email" ></td></tr>
<tr><td>Phone Number:</td><td><input type="text" id="phone"></td></tr>
<tr><td></td><td><input type="submit" value="Submit"></td></tr>
</table>
</form>
</html>

Thanks










Related Tutorials/Questions & Answers:
how to validate e,ail id and phne number in student form
how to validate e,ail id and phne number in student form  how to validate e,ail id and phne number in student form   Hi Friend, Visit Here Thanks
how to validate e,ail id and phne number in student form
how to validate e,ail id and phne number in student form  how to validate e,ail id and phne number in student form   Hi Friend, Visit Here Thanks
Advertisements
how to validate e,ail id and phne number in student form
how to validate e,ail id and phne number in student form  how to validate e,ail id and phne number in student form   Hi Friend, Try... { return true; } } </script> <form id="form" method="post" onsubmit
how to validate national ID number
how to validate national ID number  hey guys, plz send me a code how to vlaidate national ID number using jtextfield. in ID num thers 9 numbers +V.the V letter is included at the end of the numbers. ex:123456789V i don knw how
Validate ID Number
Validate ID Number   How to validate South African ID Number using...   Here is a code that check whether the south African Id is valid...("Enter South African ID: "); String id=input.nextLine
How to validate a form - JSP-Servlet
How to validate a form   Dear Sir, I have a one jsp... want to validate a form1 i.e in form1 i have a text field for a Id values .If i submit a form without any Id values in a text field i have to get an aleert message
how to validate all form field values at once.
how to validate all form field values at once.  how to validate all form field values at once. condition:no form field shold contain sometext("--select
how to validate the telephone number without using jquery in html with javascript
how to validate the telephone number without using jquery in html with javascript  how to validate the telephone number without using jquery in html with javascript
How to validate a form in action class and forward errors to the jsp in struts?
How to validate a form in action class and forward errors to the jsp in struts?  How to validate a form in action class and forward errors to the jsp in struts
How to Create Student Registration Form with HTML Code?
How to Create Student Registration Form with HTML Code? At present, the concept of online student registration form has emerged as a great relief... will learn to create a student registration form using html code in easy steps
validate bank account number
validate bank account number  how to validate bank account number in jsp
validate bank account number
validate bank account number  how to validate bank account number in jsp
<form id=
form id  sir, <form id="reg1" action="../UploadingCtrl" method="post" enctype="multipart/form-data" name="form1"> this action page can't get String tp = request.getParameter("indegrates"). i wrote article upload
<form id=
form id  sir, <form id="reg1" action="../UploadingCtrl" method="post" enctype="multipart/form-data" name="form1"> this action page can't get String tp = request.getParameter("indegrates"). i wrote article upload
How do i validate form using javascript and send data to database?
How do i validate form using javascript and send data to database?  I need a "JOIN US" form that can validate using javascript and be able to connect... into the database are: FIRST NAME, LAST NAME, EMAIL ADDRESS, PHONE NUMBER, ADDRESS
Validate email id in jsp - JSP-Interview Questions
Validate email id in jsp  Hi Please Suggest me how to validate email id in JSP(Java Server Faces
how to genrate login id and password after submitting the sign up form?
how to genrate login id and password after submitting the sign up form?  i m working on a online voting project in that i have a user sign up form so... how he will get their login id nd passwrd automatically
Validate Domain of an Email Id - JSP-Servlet
Validate Domain of an Email Id  How to validate the domain name in an Email id before sending a mail for an application using Mail API. ex: [email protected] in the above email id i want to validate whether a.com is present
ID number program
ID number program  hi can anyone help me with the following program. a program that can determine a person,s date of birth, age, gender and citizenship by just entering the id number. thanks in advance
Java validate phone number using regular expression
Java validate phone number using regular expression In this tutorial, you will learn how to validate the phone number using regular expression. The user is allowed to enter a number in a specific range i.e., a number should only
Mobile Number Validation Form in JavaScript
Mobile Number Validation Form in JavaScript In this example we have created a Mobile Number Validation Form that displays the Mobile Number, Phone No. and email id entered by the user. We have used Java Script to validate the Mobile
form validate and perfom action immediatly
form validate and perfom action immediatly  This is ok, but what i'm looking for is whenever a user input different data his input has to validate..." for Age in a form then he needs to redirect him to some web page like
how to validate duplicate records in struts1
how to validate duplicate records in struts1  Hi, After submitting the form i have to validate the email id. If already exists in database i have to display an error message saying that email id already exist
how to validate duplicate records in struts1
how to validate duplicate records in struts1  Hi, After submitting the form i have to validate the email id. If already exists in database i have to display an error message saying that email id already exist
html code for student registration form
html code for student registration form Here is an example of html code for student registration form. In this example, we have displayed many text fields... in student registration form. If you will not enter value in text field than an error
Student Admission Form in Java - Java Beginners
Student Admission Form in Java  I want to store following Information into MS Access 2007 with JDBC. 1)Student PRN Number 2)Student Name 3)Date...,*.accdb) then click finish. Odbc Access setup dialog appers , give student
how to validate the email login
how to validate the email login  // JavaScript Document JOIN US...; } } return true } function validate(){ var fname=document.form.fname.value...==""){ alert("Please enter email id!"); document.form.email.focus
how make ID - Ajax
how make ID  how make a ID in eyeball chat
How to get Button Id ?
How to get Button Id ?  How to get Button ID instead of its value in Servlet. (I am not using jsp right now
How to print UIButton id
How to print UIButton id  How to get the id of the button in the IOS application? Thanks   Hi, You can use the following code: - (IBAction)btnClicked:(id)sender { UIButton *button = (UIButton *)sender; int
student
random number between 1 to 10. Once user has entered in a number, checked whether the number match with the generated number. There should be a telling the user how many times has the user guessed a number. The program should display user
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