Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


anupama
Error display
2 Answer(s)      3 years and 4 months ago
Posted in : JavaScript Questions


I want to give a message on the screen that an error has occured...but I dont want to use alert and give pop up box...any other solution for the problem?


Advertisement
View Answers

September 5, 2011 at 3:12 PM


<html>
<script>

function validate(){

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;
   var ph=document.getElementById('phone').value;

   if(reg.test(e) == false) {
      document.getElementById('lab1').style.visibility="visible";
      document.getElementById('email').value="";
      return false;
   }
 else if(regExpObj.exec(ph) == null){
      document.getElementById('lab2').style.visibility="visible";
        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" ><label id="lab1" style="visibility:hidden"><font color="red">*Invalid Email Address!</font></label></td></tr>
<tr><td>Phone Number:</td><td><input type="text" id="phone"><label id="lab2" style="visibility:hidden"><font color="red">*Invalid Phone Number!</font></label></td></tr>
<tr><td></td><td><input type="submit" value="Submit"></td></tr>
</table>
</form>
</html>


September 7, 2011 at 1:38 PM


Thnx...



Related Tutorials/Questions & Answers:
Error display
Error display  I want to give a message on the screen that an error has occured...but I dont want to use alert and give pop up box...any other solution for the problem
error display
error display  I am creating a web page...I have two textboxes and an add button. If nothing has been entered in the textboxes and if I click the add button , I have to get pop up box indicating that "please fill in the fields
Advertisements
Display error message if data is already inserted in database
Display error message if data is already inserted in database   Display error message if data is already inserted in database Pls help me Thanks
display error message for dupliacate record in properties file
display error message for dupliacate record in properties file  This is my code. Here if the properties file contain duplicate records(i.e.)more than one entry e.x.001,002,003,001 i want to display the error message "Duplicate
this code will be problem it display the error again send jsp for registration form
this code will be problem it display the error again send jsp for registration form  I AM ENTERING THE DETAILS OFTER IT DISPLAY THE ERROR PLEASE RESEND THE CODE org.apache.jasper.JasperException: java.lang.NumberFormatException
this code will be problem it display the error again send jsp for registration form
this code will be problem it display the error again send jsp for registration form  I AM ENTERING THE DETAILS OFTER IT DISPLAY THE ERROR PLEASE RESEND THE CODE org.apache.jasper.JasperException: java.lang.NumberFormatException
display
display  please tell me how to display the content from database.. if we click on any image using servlets/jsp...please
Display a dialog box with Java Error
Display a dialog box with Java Error   ... you a code that help you in implementation of dialog box with Java Error... the execution of a program using javaw ,the program code display a dialog box name Java
error
error  while iam compiling iam getting expected error
error
; phone=ph; ss=s; mos=ms; } public void display..."+it); } } this is my program i am getting an error saying cannot find symbol class string...; } public void display() { System.out.println("Name"+name+"\naddress
Error-
Error-   Hello, I would like to know about XSD file. I try to print XML file but I am getting error SAXException-- says Content is not allowed in prolog. Please help me
error
error  i have 404 error in my program plz tell me yhe solution about
error
error  i have 404 error in my program plz tell me yhe solution about
error
/ServletUserEnquiryForm.shtml getting an error given below SQLException caught: [Microsoft][ODBC SQL Server Driver]COUNT field incorrect or syntax error please suggest
Error
Error  I have created ajax with php for state and city. When I change state then city will not come in dropdown list and it give me error as 'Unknown Runtime Error'. This error come only in IE browser, but in other brower
error
error
error
error  java.lang.unsupportedclassversionerror:bad major version at offset 6 how to solve this????   Hi, Please check the version of framework used and also the JDK version. This type error also comes when java file
error
error  When I deploye the example I have this message cannot Deploy HelloWorld Deployment Error for module: HelloWorld: Error occurred during deployment: Exception while deploying the app [HelloWorld
error!!!!!!!!!
error!!!!!!!!!   st=con.createStatement(); int a=Integer.parseInt(txttrno.getText()); String b=txttname.getText(); String c=txtfrom.getText(); String d=txtto.getText
error!!!!!!!!!
error!!!!!!!!!   st=con.createStatement(); int a=Integer.parseInt(txttrno.getText()); String b=txttname.getText(); String c=txtfrom.getText(); String d=txtto.getText
error!!!!!!!!!
error!!!!!!!!!   st=con.createStatement(); int a=Integer.parseInt(txttrno.getText()); String b=txttname.getText(); String c=txtfrom.getText(); String d=txtto.getText
Error
Error  Hi. I am getting error in the following code after the line I have commented as ERROR. How to solve this. Thanks in advance. package...;"); // ERROR out.println(" var pattern
Error
Error  Hi. I am getting error in the following code after the line I have commented as ERROR. How to solve this. Thanks in advance. package...;"); // ERROR out.println(" var pattern
Error
Error  Hi. I am getting error in the following code after the line I have commented as ERROR. How to solve this. Thanks in advance. package...;"); // ERROR out.println(" var pattern
Error
Error  Hi. I am getting error in the following code after the line I have commented as ERROR. How to solve this. Thanks in advance. package...;"); // ERROR out.println(" var pattern = /^\d{3,5
error
error  whats the error.............. import java.util.Scanner; public class g { public static void main(String[] args) { Scanner s=new Scanner(System.in); int d,x,y; System.out.println("Enter the first number
How to create and use custom error page in jsp
and use custom error page in jsp and display an error message. Before run... How to create and use custom error page in jsp...;   error_page.jsp <!DOCTYPE HTML PUBLIC "-//W3C//DTD
Display Tag
Display Tag  Hi Here is My code, There is problem At line no.3, where i want to display two fields in one column but it gives error.. Please any one knows the solution must reply Thanks In Advance
Display Tag
Display Tag  Hi Here is My code, There is problem At line no.3, where i want to display two fields in one column but it gives error.. Please any one knows the solution must reply Thanks In Advance
php display errors
php display errors  i don't know how to display the error using PHP
error message
error message  Sir i make one form facility with insert,update,delete.i want to error msg if any type of the data is missing and display in error msg which of the data is misssing
 

 

 

DMCA.com