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



Home Answers Viewqa JSP-Servlet PROBLEM IN FORM VALIDTION

Have Programming Question? Ask it here!
 
 
 


Anie Mukherjee
PROBLEM IN FORM VALIDTION
0 Answer(s)      a year and 3 months ago
Posted in : JSP-Servlet


i applied validation IN THIS JSP PAGE.if i leave username/password empty,i will be promped to enter those to feilds.but the PROBLEM is that after i press OK on validation prompt,the page goes to 2_control.jsp.I WANT IT TO GO TO NXT PAGE ONLY IF the validation thing is ok,not otherwise.plz hlp.

Hi. Here is my code:

<html>
<head>
<script>
function validLogin(){
if (document.form.userName.value == ""){
alert ( "Please enter Login Name." );
document.loginform.userName.focus();
return false;
}
if (document.form.password.value == ""){
alert ( "Please enter password." );
document.userform.password.focus();
return false;
}
alert ( "Welcome User" );
return true;
}
</script>
</head>
<body>
<form name="form" method="post" action="2_control.jsp" onsubmit="return validLogin();">
<table width="250px" border=0 style="background-color:ffeeff;">
<tr><td colspan=2 align="center" style="font-weight:bold;font-size:20pt;" align="center">User Login</td>
</tr>
<tr><td colspan=2> </td>
</tr>
<tr><td style="font-size:12pt;" align="center">Login Name:</td>
<td><input type="text" name="userName" value=""></td>
</tr>
<tr><td style="font-size:12pt;" align="center">Password:</td>
<td><input type="password" name="password" value=""></td>
</tr>
<tr>
<td></td>
<td><input type="submit" name="Submit" value="Login"></td>
</tr>
</table>
</form>
</body>
</html>

Thanks.


Advertisement
View Answers

Related Tutorials/Questions & Answers:
PROBLEM IN FORM VALIDTION
PROBLEM IN FORM VALIDTION  i applied validation IN THIS JSP PAGE.if i... the PROBLEM is that after i press OK on validation prompt,the page goes...; } </script> </head> <body> <form name="form" method="post
PHP Sticky form problem
PHP Sticky form problem  I have done the full coding of a sticky form.... Please see my coding below...and advice me what is the problem, and what...;/head> <body> <h1>Simple Calculator</h1> <form action
Advertisements
PHP Sticky form problem
PHP Sticky form problem  I have done the full coding of a sticky form.... Please see my coding below...and advice me what is the problem, and what...> <form action="simple_calculator.php" method="post"> <p>Number 1
Form Processing Problem
Form Processing Problem  I am trying to create a Circular Page... to Null and //as well as the passed data from mulitpart/form-data is greater...; (contentType.indexOf("multipart/form-data") >= 0)) { DataInputStream
Problem in enctype="multipart/form-data" in JSP
Problem in enctype="multipart/form-data" in JSP  im using a page... the file itself when i click the submit button. im using enctype="multipart/form-data" in this form. i also using the commons-fileupload-1.2.2.jar file for getting
Problem when resizing the form - Swing AWT
Problem when resizing the form  Hi, I am facing a problem when resizing the form. I have a JTextPane on the JInternalFrame which occupy all the form space at initial stage. we have a button to add a new JTextPane on the form
New Problem in Form Resizing - Swing AWT
New Problem in Form Resizing  Hi, I am using a MDI application...)); The problem is arising when the user resizes the form. The EditorPane(old... the form? This problem is occuring only the components which are added
Problem submitting a struts form containing a dojo script - Struts
Problem submitting a struts form containing a dojo script  Hello there, Is there any way to make use of dojo with struts 1 ? Actually, I'm facing a problem submitting a struts form containing a dojo script for a dynamic
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.... 1)register.jsp <html> <form method="post" action="insert.jsp"> <
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.... 1)register.jsp <html> <form method="post" action="insert.jsp"> <
form
form   Can I prevent a form from being submitted again
jsp form
jsp form  hi sir, one got one got in jsp form after entering the data into the form the data is not saving in the database i will send you code of two forms if dnt understand my problem
PHP form
PHP form  Hi Sir/Madam, I am developing an attendance form using php... am adding one textfield to enter the Attendance... The problem is I am... form and update them to respective coloumn... Please any one help mo out please
form validation
form validation  how the form validation is done in jsf form using javaScript
print a form of *
print a form of *   * *** ***** ******* ********* ******* ***** *** *   Post the format properly
Multipage form
Multipage form  I have a multipage form in php with 2 pages wnhen i submit the form data from both the pages should go in database how should i pass teh data from 1st page to 2nd page and then put the entire form data in mysql
dynamic form
dynamic form  I need to make a dynamic form using php, for example, i... button wich once clicked we have a new list created on the same form. Thank you...("There was a problem while using XMLHTTP:\n" + req.statusText
submit a form
submit a form  How can we submit a form without a submit button
Ajax form element - Ajax
Ajax form element  I have problem in passing a value into form feild using ajax. I want to get the value is as a parameter. Can some one help me plz
Form handling
Form handling  I created a spring project. I created a jsp...;form:form name="loginForm" modelAttribute="loginForm" method="get"> <...;/td> <td> <form:input path="username"/>
Form Validation
Form Validation  Java script validation for checking special characters and white spaces and give an alert.Please help me urgent Thanks in advance
<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
Form validation
Form validation  Hi Everyone Can someone assist me with a complete code to validate a form. e.g where the user must insert an ID number it should check if the user entered the correct data and within a valid range. This must
other form
other form  Can I write this code in other form: if (quantity>=5) { System.out.println("Congrats!! You get a discount of 5%."); } else { System.out.println("you can avail a discount of 5% when you make a purchase of 5 items
Employee form
Employee form  In employee form emp Id id after any data iserted is incremented for oher data insertion. insert, delete, update buttons when we cleak the select buttoun then the created table data iserted automaticaly
struts form
struts form  Hi, This is Rajesh.I'm creating struts form in jsp.i have two textboxes in my jsp.During Jsp page loading focus will automatically should come to second textbox(That means during page loading cursor automatically
login form
login form  sir my next form consists logout button when i click on it it showing login form but next form window is not closing but the components prepsent in that form are getting clearedup using frameobject.setVisible(false
login form
login form  sir my next form consists logout button when i click on it it showing login form but next form window is not closing but the components prepsent in that form are getting clearedup using frameobject.setVisible(false
Login Form
of +,on clicking which a login form appears. Only the middle column is different
Login Form
of +,on clicking which a login form appears. Only the middle column is different
jsp form
jsp form  hai... GoodEvening I have one doubt on jsp.please wil u clarify it. how to move one jsp form to another jsp form with out using forward...)form1.jsp: <html> <form method="post" action="form2.jsp"> <table>
form submission
form submission  I have two pairs of textboxes...( so in total 4...("Enter text4 value!"); return false; } return true; } </script> <form name="form" method="post" onsubmit="return validate();"> <input type="text
dropdownbox-form - Struts
dropdownbox-form  i have a problem i was create combobox using... form and i use that fields for database insert if any one understand my problem give reply and send to gullapalli.phani@gmail.com waiting for reply
form validation
form validation  <form name="form" method="post" action="process.php" onsubmit="return validate(); "> <table align="center" border="1px" bgcolor="orange" > <tr><td>username:</td><
about form
about form  how to dynamically increase the textbox in the 2nd form when i gave any value in textbox of form1 . if i gave 5 in the textbox of form1 , totally 5textbox have to be created in form2.   import javax.swing.
HTML form - Java Beginners
(form1 and form 2)with several fields in html. When i click the submit button, it validates all fields then moves to form2. i have a problem with form navigation. i... friend, Code to help in solving the problem : when You submit the form
Dynamic form
Dynamic form  I need to make a dynamic form using jsp for example, i will need a list of items which when we select one option another list... clicked we have a new list created on the same form. Thanks for your help  
jsp form
jsp form  hi i have one excuted jsp form.and in that the data should be dispaly on another jsp form.please help me thanks in advance   Hi Friend, Try this: 1)form1.jsp: <html> <form method="post" action
Problem in enctype=
Problem in enctype=  im using a page which is in JSP. i have some... the submit button. im using enctype="multipart/form-data" in this form. i also using.... but the problem is the uploaded file is not stored in the prefered folder. i printed
registration form
="center" border=0&gt; &lt;form name="f1" action="CreateUser
AJAX REGISTRATION FORM
selection using ajax, in the html registration form. I am loading two XML... either username or state. How to implement both in same registration form could any one help me outâ?¦ to overcome this problem
disable the form - JSP-Servlet
are different.when I click the form button,one function is calling and the input... Ajax. after response is coming to the jsp page,particular form button will be disabled.remaining are enabled. How can I solve this problem. please help me
uploading problem
;font size="+3" color="white"> <TABLE> <tr><td><form...; <TABLE> <TR><TD><form name="form2" action...(); } } } } %> my problem...: firstly
problem:struts code - Struts
problem:struts code  Hi, Am using struts1.2.I wrote a form(dynavalidator form)with validation after completing the form if we press submit its call the action class,in action class i gave forward to same form,the problem is if i
problem in onlinetest...
problem in onlinetest...  hi, my code getting the problem is ,when user leave a question then the server puts error... pls help me
jsp problem
jsp problem  problem:::::::: On JSP form ,when i insert data in text... and get assign to other field on that form........ when data is assign to other field on that form at that time firstly inserted data is not present on that form
JavaScript Form Validation
JavaScript Form Validation  JavaScript Form Validation
Problem in jsp.
Problem in jsp.  hello friends, I have a problem in jsp.I want to insert data, which is given by user through a html page into a table.And the table... in advance.   1)form.html: <html> <form method="post
Problem in jsp.
Problem in jsp.  hello friends, I have a problem in jsp.I want to insert data, which is given by user through a html page into a table.And the table... in advance.   1)form.html: <html> <form method="post
Advertisements
 

 

 

DMCA.com