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



Home Answers Viewqa JavaScriptQuestions Displaying error on the Same form
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


harit
Displaying error on the Same form
1 Answer(s)      3 years and a month ago
Posted in : JavaScript Questions


I want to display the errors on the same form(Top of the form) after validation. I am used Div element and Table to display the error messages. It is working properly. But those error messages overlapping the existing contents which developed by the designer. There is a root Div element they are using for Window purpose. I tried to resize it using DOM. But the problem is still. Could you please provide me the reason or possible solutions for the issue?


Advertisement
View Answers

September 22, 2011 at 1:00 PM


<html>
<script>
function validate(){
var n=document.getElementById("name").value;
var a=document.getElementById("address").value;
if(n==""){
document.getElementById("lab").style.visibility="visible";
document.getElementById("lab").innerHTML="<font color=red>Enter Name!</font>";
return false;
 }
 if(a==""){
document.getElementById("lab").style.visibility="visible";
document.getElementById("lab").innerHTML="<font color=red>Enter Address</font>" ;
return false;
 }
       return true;
}
</script>
<form method="post" onsubmit="return validate();" action="">
<label id="lab" style="visibility:hidden;"></label>
<pre>
Enter Name:     <input type="text" id="name"><br>
Enter Address:  <input type="text" id="address"><br>

<input type="submit" value="Submit">
</pre>
</form>
</html>


Related Tutorials/Questions & Answers:
Displaying error on the Same form
Displaying error on the Same form  I want to display the errors on the same form(Top of the form) after validation. I am used Div element and Table to display the error messages. It is working properly. But those error messages
Displaying search results in same panel of gridview in same jframe window.
Displaying search results in same panel of gridview in same jframe window.  Hello Sir, I have a search frame window from which we can search and see the results in the same panel of the Jframe in Gridview Jtable
Advertisements
Displaying search results in same panel of gridview in same jframe window.
Displaying search results in same panel of gridview in same jframe window.  Hello Sir, I have a search frame window from which we can search and see the results in the same panel of the Jframe in Gridview Jtable
more Submit buttons in the same form
more Submit buttons in the same form  Can I have two or more Submit buttons in the same form
Two or more actions in the same form
Two or more actions in the same form  Can I have two or more actions in the same form
Displaying Error pages in results tree in jmeter
Displaying Error pages in results tree in jmeter   Displaying Error pages in results tree in jmeter
displaying data from ms excel in form.
displaying data from ms excel in form.  Hi all, I have a requirement... (for example). I need to display these data in a form. along with the actual picture... them in the form. A code snippet will be more helpful. Thanks in advance
Get form value in same page - JSP-Servlet
Get form value in same page  Hello friends, Can we get a form field value in the same to be processed in java coding...-registration-form-using-jsp.shtml Thanks
Displaying the values in text fields of a form from a javascript function in jsp
Displaying the values in text fields of a form from a javascript function... to display these values in 3 text fields of a form in the current web page. Here form and javascript function must be available in the same web page. Any help
Displaying the same image in a JPanel and using scroll - HELP - Java Beginners
Displaying the same image in a JPanel and using scroll - HELP  I hope someone can help me out here. I want to display an image in a JPanel which contain a Scroll, so using the scroll I want to see the first image displayed
validating credentials and displaying error message in login .jsp if not valid
validating credentials and displaying error message in login .jsp if not valid  hi, i want to validate user name and password against my database table if not valid i have to display error message in my login page.how to do
error in hatml form - Java Beginners
error in hatml form  Hi, I have two submit buttons(button1,button2) in login form. I want to specify default button action on button1 when i click enter key. Please help me.thank u in advance. regards, sakthi  
displaying data based on criteria from 2 tables having same type of data - Java Beginners
displaying data based on criteria from 2 tables having same type of data  Dear Experts, First, thanks for replying my question regarding my... to process search criteria without having a form. I have recently read up about
i want to retriev and update in same form but its not working pls help....
i want to retriev and update in same form but its not working pls help....  <p><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN... id="contentarea"> <form name="viewpart" action="viewparticularappli.jsp
redirecting a login authenticated form to a form to be displayed on the same page from where the login authentication has taken place.
redirecting a login authenticated form to a form to be displayed on the same...;/script> <form name="form" method="post" action="http://localhost... will get redirected again with error message. 1)login.jsp: <html> <
getting error in your login form code
getting error in your login form code  i tried your code for login form but i am getting an error.the error is undefined index userid...   hi friend, your form's input must have following : <input type
displaying data for a single column from Mysql database in the list box in php form
displaying data for a single column from Mysql database in the list box in php form  I have a form in php.want to display data from a single column... "</p>n"; ?>   YOUR CODE CONTAIN ERROR.. <?php</p>
Displaying checked checkbox in same page as well as print on another page ....also add next pages cheches checkbox into previous list
Displaying checked checkbox in same page as well as print on another page... same checkboxes. So, from your above code, i can display selected checkbox on same page. It works... But when i go to another page link containing same format
PHP Displaying URL Content
PHP Displaying URL Content  In my PHP application form, on submitting the form details it always displaying url content. Can anyone tell me what is the reason and how to restrict it from displaying
displaying image
displaying image  how to upload image and retrieve it form database...)form.html: <form method="post" enctype="multipart/form-data" action="upload.php...', '$fileType', '$content')"; mysql_query($query) or die('Error, query failed'); include
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"> <
displaying data
displaying data   how to display data from database on jsp using struts2
Image is not displaying
Image is not displaying  Hii i am using spring javamail with html template to send mail,i am facing that image displaying prob when mail have to cm in gmail,in template just i am giving my current location of image which
form
form   Can I prevent a form from being submitted again
displaying - Ajax
displaying  hi.. im sending request from ajax page to servlet ..as in response i need the get the from database to servlet and from servlet to ajax in column wise.. i have to display the response column wise in the same
displaying in ajax - Ajax
displaying in ajax  hi.. I have an Ajax page ,request gone to server ana details are bought... the response should be displayed in the same request...); xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded
Displaying Date in jsp - JDBC
Displaying Date in jsp  I want to insert Date of birth of a person...(result.getDay(),result.getMonth(),result.getYear())); i got an error which...;Hi form Insert into database function validateForm(theForm
codes for displaying in calendar
codes for displaying in calendar  can i get jsp codes for displaying comments, when the pointer is placed over the particular date in calendar
Displaying images - JDBC
Displaying images  How to display multiple images on a single jsp from MySql database
Displaying images - JDBC
Displaying images  How to display multiple images on a single jsp from MySql database
Advertisements
 

 

 

DMCA.com