Home Answers Viewqa JSF-Questions problem in java script

 
 


sarika
problem in java script
1 Answer(s)      4 years and 8 months ago
Posted in : Java Server Faces Questions

View Answers

October 15, 2008 at 10:20 AM


Hi,


<html>
<title>Email validation in JavaScript</title>
<head>
<script type="text/javascript">

function checkEmail(email) {
if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email)){
return (true)
}
alert("Invalid email address.Please Enter again.")
return (false);
}

function validateForm(theForm){

if(theForm.email.value==""){
alert("Please enter email!");
objForm.email.focus();
return false;
}

if(!checkEmail(theForm.email.value)){
theForm.email.focus();
return false;
}

return true;
}
</script>

</head>
<body>
<br>
<br>
<center>
<table border="1" width="500px" bgcolor="lightblue">
<tr>
<td width="100%">
<form method="POST" action="" onsubmit="return validateForm(this);">

<h2 align="center">Email validation</h2>
<table border="0" width="400px" cellspacing="2" cellpadding="3">

<tr>
<td width="50%"><b>User Name:</b></td>
<td width="50%"><input type="text" name="userid" size="25"></td>
</tr>
<tr>
<td width="50%"><b>Email ID:</b></td>
<td width="50%"><input type="text" name="email" size="35"></td>
</tr>
</table>
<center>
<p><input type="submit" value="Submit" name="submit">
<input type="reset" value="Reset" name="reset"></p>
</center>
</form>
</td>
</tr>
</table>
</center>
</body>
</html>

-----------------------------------------

Thanks.









Related Pages:
script problem - Java Beginners
script problem  Even though both .js file and .jsp file present in the same location,script is not working in mozilla but working in Internet... what i have written present in same location. but the script
java script code problem - Java Beginners
java script code problem  Dear sir, my problem is that, suppose i've two HTML files(with java script), out of them one has function EMPLOYEE_DETAILS() i want to call this EMPLOYEE_DETAILS() fuction to another Html file, how
Jsp/java-script, spring combination problem
Jsp/java-script, spring combination problem   Hi Friends....... I am developing one application using jsp,spring,java script,hibernate,Pojo There is one Jsp form on that I want data as location and ward wise; There is two
problem in java script - Java Server Faces Questions
problem in java script  hi deepak i want to apply validation on email field of form nd i make this prog. but this is not working plz send me solution of my prob asap . ss function validate() { var error=false
Java Script Code Problem - JSP-Servlet
Java Script Code Problem  how to concatenate html table values(there are 3 rows,each row contains 3 fields) into variable and display it using javascript  Hi Friend, Try the following code: document.write
script code - Java Beginners
script code  hi, thanks for ur fast reply. plzz, give me a sample code for PHP function under script tag. regards, sakthi  Hi friend, Code to help in solving the problem : Hello PHP World
Java script - Development process
java script code for that its working in IE not Fire Fox, actually...Java script  Dear Sir/Mdm I have a probem, when any user close... my problem and which will work both IE n FF. Regards Amit
java script - JSP-Servlet
java script  what is the use of hidden fields in java script? if a page has 3 links the first link should be enabled and others should be disabled... problem then send me source code and explain in detail
Java Script Program
Java Script Program  <%-- Document : index Created... are available in the Sun Java System Application Server 9.1 logs. Sun Java System Application Server 9.1 Where Is The Problem? Please Help
Java Script Program
Java Script Program  <%-- Document : index Created... are available in the Sun Java System Application Server 9.1 logs. Sun Java System Application Server 9.1 Where Is The Problem? Please Help
java script code
java script code  Hi Deepak, Firstly wanna share the problem em facing: working with servlet and jsp for my project. I have 3 main jsp pages which interacts with user for accepting user input and supply them
java script - JSP-Servlet
java script  hello buddy......i m new to here....please help me to solve my problem i have a jsp page with pre populated value comming from other jsp.....ones i submitted i have to clear that page and i have to submite
selectoptions errors in java script
selectoptions errors in java script  hi, in my web page when I select the color of the image it displays that particular color but when i again opt the select option it displays errors message. How do I rectify this problem
java script,java - Java Beginners
java script,java  hi deepak i have one image is there.beside the image ihave 11 digital numbers is there.that digital numbers we can drag... Friend, Please clarify your problem. Thanks
Ant Script Problem - Ant
Ant Script Problem  I refer roseindia's(www.roseindia.net) Ant tutorial. According to that I tried to create tables using Ant script, but it throws... this Problem? Regards, K.Senthuran   Hi friend, Your Problem
java script - Struts
java script  how validation for date is performed in the top-down select.if the user clicks submit without selecting the date, month and year. what... in solving the problem : a.first:link { color: green;text-decoration:none
Merging of java script with servlet program
Merging of java script with servlet program  how can we merge the java script with the any servlet program for making web application intractive.Is there any program you have.\please help me to sove out this problem
Java Script - JSP-Servlet
Java Script  hi, im having a problem in updating the cart. below is the code for that. what i want is i need to enter the how much quantity by entering in the textbox and when i click on the update cart i need to display
Java script
Java script  Source code for capturing the screen using Java Script
Java Script
Java Script  why we are using java script
Java Script
Java Script  Hi, Any one please share a code to swap the 2strings using java script
Java Script
Java Script  What is Java Script? How to learn Java Script?   Hi Java Script is client side programming language. It runs on browser.... You can learn Java Script from our JavaScript - JavaScript Tutorial pages
java script in jsf - Java Server Faces Questions
java script in jsf  How to populate a text value for the list box using java script? I have a problem in populating the text value for the list box... and some exceptions have occured .can u pls sort out my problem
java script
java script  how to write a Java script program to enter number in two text fields and then automatically display the total in another text field
Java script
Java script  a java script code for accept 10 numbers from the user and print in the descending order without using sort method
java script
java script  Hi, Any one please tell me how, to store below elements in an array using java script 12,13,14,a,b,xyz
Java Script.
Java Script.  Hi Sir, The below java script code is not working in Google chrome can yo give me the solution as soon as possible. <script type="text/javascript"> function setValue(){ var val=""; var frm
Java Script.
Java Script.  Hi Sir, The below java script code is not working in Google chrome can yo give me the solution as soon as possible. <script type="text/javascript"> function setValue(){ var val=""; var frm
Java Script.
Java Script.  Hi Sir, The below java script code is not working in Google chrome can yo give me the solution as soon as possible. <script type="text/javascript"> function setValue(){ var val=""; var frm
Java Script.
Java Script.  Hi Sir, The below java script code is not working in Google chrome can yo give me the solution as soon as possible. <script type="text/javascript"> function setValue(){ var val=""; var frm
java script display value - Java Beginners
java script display value  my code is below: my problem is: the value 'firstname' is not showed with getparameter in .jsp file? (when click submit button in form) Main file: Name: file java
Java Script.
Java Script.  The below code is nit working in Google chrome can any one tell me the solution as soon as possible. <script type="text/javascript"> <!-- function setValue(){ var val=""; var frm
java script
java script  how will you identify whether the number entered by the user has two digits or three digits.Assuming that the user enters only a three digit or two digit number.   <HTML> <HEAD> <SCRIPT
java script
java script  write a java script code which provide a menu for user which will enable him/her to either add or subtract or multiply or divide two numbers and produce the corresponding result.   <html> <
java script
java script  when you click a button how will you change the background color of a web page
java script
java script  I want to display set of radio buttons after i select one option of the combobox
java script
java script  what is the use of getElementById() method in jsp. and give me its full knowledge with a example
java script
java script  hi deepak, i have small doubt in the date ranges that when i select the date range then it display on the text boxes. example:suppose i select the weekly date range then the dates are display on the text boxes up
Java Script
Java Script  I want to display an error message for the validation of email at the top of the page in red font i want to use java scripts but i dont want to use alert box what i need to do   <html> <script>
multiple browsers in java script - JSP-Servlet
multiple browsers in java script  How to make my jsp browser specific?  Hi friend, For solving the problem visit to : http://www.roseindia.net/jsp/simple-jsp-example/JSPPlugins.shtml Thanks
problem
problem  Hi, what is java key words   Hi Friend, Java Keywords are the reserved words that are used by the java compiler for specific... information, visit the following link: Java Keywords Thanks
code problem - Java Beginners
java script j2ee j2me sql plz help me to sort out this problem. thnx  ...code problem  Dear sir, I'm havin a problem that suppose i've got a file that contains the following lines- java java script j2ee php sql
problem
problem  hi'sir mai niit student hu.mujhe java ka program samaj me nhi aata mai kya karu and mai kaise study karu please help me.   Learn Java from the given link: Java Tutorials
how to execute a unix shell script from a java program
how to execute a unix shell script from a java program  well , i am facing this problem.. i have tried a few sample codes but there isn't any... the script name from a java code .once you execute this java program
defining numbers in Java Script
defining numbers in Java Script  Explain about defining numbers in Java Script
Java script in servlet
Java script in servlet  Hi. How to use javascript inside java servlet? Thanks in advance
Java Script location.replace method
Java Script location.replace method  Hi, What does `Print `{<SCRIPT LANGUAGE="JavaScript"> location.replace("} & urlpop & {","BOTTOM") </SCRIPT>} this mean as this is written in an Lotus Script agent and I
script error - Java Beginners
script error  hi, Is it possiple to use PHP function under the script tag. plz help me. thank u in advance. regards, sakthi  Hi Friend, Yes It is possible to use PHP function under the script Tag. Thanks
JAVA SCRIPT CODE FOR OPENING A WEBSITE IN A NEW WINDOW - Java Beginners
JAVA SCRIPT CODE FOR OPENING A WEBSITE IN A NEW WINDOW   PLS TELL ME? HOW CAN I DEFINE A WINDOW.OPEN FUNCTION WITHIN ANOTHER FUNCTION e.g... in solving the problem : JavaScript Window Open function poponload

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.