HTML form example
Posted on: March 28, 2011 at 12:00 AM
In this section we will show you how to create HTML form. The HTML form example will teach you how to perform HTML form validation.

HTML form example

In this section we will develop HTML form example and show you how to performance form validation using JavaScript.

The HTML <form>..</form> allows the developers to create data input screen that runs on browser. In this example we will create a simple from that takes input from user and then validate it.  The HTML form is written in HTML markup language, which runs on the web browser. The HTML form is used in dynamic web applications for taking the user's input. This is the only one way to take input from the user.

In this example code we will show you to make HTML form and also validate it with the JavaScript.

Here is the screen shot of the HTML form that we are creating in this tutorial:

HTML form

Here is the code of the same:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title> HTML Form Example </title>
<script type="text/javascript">
function check()
{
var varname=document.getElementById('name').value;
var alphaExp = /^[a-zA-Z]+$/;
if (varname=='' )
{
alert('Student name is required');
}
if (document.getElementById('class').value=='')
{
alert('Student class is required');
}


if (document.getElementById('dob').value=='')
{
alert('Date of birth is required');
}
if (document.getElementById('address').value=='')
{
alert('Address is required');
}
if (document.getElementById('phone').value=='')
{
alert('Phone is required');
}
if (document.getElementById('email').value=='')
{
alert('Emial is required');
} }
</script> </head>
<body>
<center> <h1 style="font-size:x-large">Student Information Form</h1> </center>
<hr>
<br>
<center>
<form>
<table>
<tr>
<th><label for="name" id="lname" >Student Name</label></th>
<th> : </th>
<td><input type="text" name="name" id="name"></td></tr>
<tr>
<th><label for="class" >Class </label></th>
<th> : </th>
<td><input type="text" name="class" id="class"></td>
</tr>
<tr>
<th><label for="dob" >DOB</label></th>
<th> : </th>
<td><input type="text" name="dob" id="dob"></td>
</tr>
<tr>
<th><label for="address" >Address</label></th>
<th> : </th>
<td><textarea name="address" id="address"></textarea></td>
</tr>
<tr>
<th><label for="phone" >Phone</label></th
><th> : </th><td><input type="text" name="phone" id="phone"></td>
</tr>
<tr>
<th><label for="email" >E-Mail</label></th>
<th> : </th> <td><input type="text" name="email" id="email"></td>
</tr>
<tr>
<th><input type="reset" name="name"></th>
<th> : </th>
<td><input type="submit" name="name" onclick="check()"></td>
</tr> </table>
</form>
</center>
</body>
</html>

The above code will display the from to use and then validate the input also.

You can try the form online.

More Tutorials on roseindia.net for the topic HTML form example.
HTML Form Validation example
HTML Form Validation example  Can anyone guide me how to validate the user name and password field in HTML using simple or JavaScript Validation. Thanks in advance!   <form method="post" onsubmit="return
 
HTML form example
HTML form example In this section we will develop HTML form example and show... input from the user. In this example code we will show you to make HTML form...; <title> HTML Form Example </title> <script type="text
 
HTML form examples
({});   Hi, Please see the HTML form example page. Thanks...HTML form examples  Hi, How to create a simple data entry form in HTML and use JavaScript to validate the same. Can anyone share html form examples
 
example of 1700 bir form using html
example of 1700 bir form using html   example of 1700 bir form using html i don't know how to start it... i'm confused on what would i do first and what would i use... :( please help me on this.... thank you in advance
 
HTML to php form
HTML to php form  Hi, How I can submit the HTML form data to PHP Script? Give me example code. Thanks   Hi, Please see the following tutorials: PHP Form PHP email form Thanks
 
web form(html) with jdbc
web form(html) with jdbc  need a example coding to develop a web form of data with jdbc   Hi Friend, Try the following code: 1)form.html: <html> <form method="post" action="http://localhost:8080/examples/jsp
 
Copy text file in a HTML form.
Copy Text File in a HTML form For copying a text file from one source to other destination in HTML form, you will have to create a HTML form and call the form...,$destinationfile); } ?>  Draw the HTML form <!DOCTYPE HTML PUBLIC
 
Opening a file in a HTML form
Opening a file in a HTML form In this example, you will first see that a form has been created in HTML format and the code of opening a file has been written separately.  First create a HTML form and call the php action file to open
 
HTML Post Form
The Tutorial illustrates an example from HTML Post Form. In this Tutorial, the code explain... HTML Post Form       The HTML process the submission of form in two different ways. In HTML
 
What is HTML Form?
the input elements for taking user input. Here is an example of HTML Login form... What is HTML/Web Form in HTML? In this tutorial we are going to understand about the HTML form, which is also know as the Web Form. This is used
 
How to create simple HTML Form?
HTML form example. (adsbygoogle = window.adsbygoogle || []).push...HTML Form Tutorial: How to create simple HTML Form? In web application input forms are developed using the HTML tags and the form component provided
 
HTML
of their attributes through examples.   What is HTML Form? Learn about HTML... the importance of HTML Login Page for web applications.    Form... Form and their attributes.    HTML
 
Form Tag Example
.style1 { color: #FFFFFF; } Form Tag Example  ... the form tag. The form tag is a UI tag that renders HTML an input form. The remote... from the form can be inserted into any HTML element on the page. Add
 
JSP:HTML Form in-place Editing - JSP-Servlet
JSP:HTML Form in-place Editing  Hi, I want to thank the people... developer's needs. This is a follow up to the HTML Form in-place editing. The code... an excellent way of editing a form. I just have a few adjustments if any of you could
 
HTML Code for registration form
HTML Code for registration form Here is an example of Registration form using... to take the input for the user. The most basic and frequently used form is the HTML... basic form of the HTML from. We can use the JavaScript to validate the user
 
Html form that auto fills outlook to,subject,body
Html form that auto fills outlook to,subject,body  I want to have... in it. Below is a working example. My problem is I can only get the form to work... and body message. The user will fill out a form on-line when they click send
 
PHP HTML Form
PHP & HTML Form: In the current tutorial we will study about PHP and HTML form, we will see how to send HTML . We will combine one html file and PHP... Exaplanation: In the above HTML file we create a HTML form and send the data
 
HTML Form data into .CSV?
HTML Form data into .CSV?  how to store data from html form to csvfile in java
 
PHP HTML Form Submit Button
Topic : HTML FORM SUBMIT BUTTON Part - 4 The another part which is important... of the tutorial then our Html form has covered the action and method attribute.... The Submit button in Html is used to submit form data to the page mentioned
 
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... form in HTML?":ADS_TO_REPLACE_1 In the above video instruction we have
 
HTML5 form example, How to implement form tag in html document.
HTML5 form example, How to implement form tag in html document. HTML form tag... is input controls, which is use for input user data. A HTML form always starts <... it is use for registration , order, searching etc. Html form is a pair tag. OR Form
 
Registration Form in HTML
Registration Form in HTML  User Registration Form in HTML - i wanted to design a user registration form in HTML. So, Can anyone please guide me or give me a peace of code to design a user registration form in HTML. Thanks
 
HTML table example
HTML Table example In this page we will learn how to use HTML table tag with the help of examples. HTML table tag is used to display the data into tabular form on the web page. Here is an example of HTML Table
 
html form - Java Beginners
html form  Hi
 
HTML
HTML  How do we create a link? What are the three types of form tags in HTML
 
html
html  how we can give the form actions in html after register button in the login page
 
HTML -- form tag.
HTML -- form tag. Description : HTML provides a form tag. It takes user... within form tag. Code : <!DOCTYPE html PUBLIC "-//W3C//DTD... language</title> </head> <body> <h1>HTML form tag
 
html form - Java Beginners
html form  Hi, I wnt to design a form with more than one action in submit button.thanks. regards, sakthi  Hi friend, You specify your main requirement of form with more then one action. Thanks
 
HTML form - Java Beginners
HTML form   Hi, thank u for fast reply. I have two forms (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
 
Process HTML FORM data
Process HTML FORM data  Can a JSP page process HTML FORM data?   Yes. Preemptive termination of request processing on an error condition is a good way to maximize the throughput of a high-volume JSP engine. The trick
 
Html
Html  in the web page if judge select the age and category then automatically under that conditions the details will be display in the form of grid give me that code in html and java
 
if there is an invalid entry in html:file control then form is not submitting. - Struts
if there is an invalid entry in html:file control then form is not submitting.  Hi, I have used html:file to upload the files. this is working... the file then submit the form - form will submit without any problem 2) don't
 
HTML
HTML  Hi, What is the full form of HTML? Thanks (adsbygoogle = window.adsbygoogle || []).push({});   Hi, The HTML stands for HyperText Markup Language. HTML is used to create webpage for world wide web
 
create html form as follows
create html form as follows  a form that contains two textboxes;one for your name and another for telephone number.telephone number should have exactly 10 digits starting with the digit '9' and name should not be left blank.add
 
create html form as follows
create html form as follows  a form that contains two textboxes;one for your name and another for telephone number.telephone number should have exactly 10 digits starting with the digit '9' and name should not be left blank.add
 
HTML form methods GET and POST
HTML form methods GET and POST  What is the difference between the HTML form methods GET and POST
 
html form - JSP-Servlet
html form  how to retrieve database value in dropdown list box placed in html form  Hi friend, Visit for more information. http://www.roseindia.net/jsp/ Thanks
 
HTML
HTML  how can we design the gird form view in html i want the following fields in the grid form The fields are Name of the candidate,Title... me the coding for this in html
 
HTML
HTML  I want the following fields as in the form of grid view Fields... of the work,image of the work,points from the judges and above of this grid form i... and age buttons then automatically displays the grid form and display the values
 
Developing Forgot Password Form
;/head> Make a form using Struts tag <html:form action="...;td><html:form action="/userforgetpassword" method="post"...; </body> </html:html> View Of the form
 
HTML
HTML  in html how can we can upload the file <tr> <... with form action when i click the upload button it wil goto some where to upload the file give me the code for this in html and java
 
Passing Parameter Using Html Form
Passing Parameter Using Html Form       This is a very simple example in which we are going....  To get the desired result firstly we have to make one html form which
 
Handling multiple buttons in HTML Form
Handling multiple buttons in HTML Form  How to handle Handling multiple buttons in HTML Form
 
Html
:48:44 PM Author : SAMSUNG --%> <%@page contentType="text/html" pageEncoding="UTF-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01...; <head> <meta http-equiv="Content-Type" content="text/html
 
Html
:48:44 PM Author : SAMSUNG --%> <%@page contentType="text/html" pageEncoding="UTF-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01...; <head> <meta http-equiv="Content-Type" content="text/html
 
Html
Html  in html form for the address by using input as textarea i am writing the code as <tr> <td valign="top"><strong>Address: </strong></td> <td><textarea name="Address" rows="8
 
html
html   HTML document with Javascript to count the number of vowels... HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD>...(ch) != -1) count++ } document.form.no.value=count; } </script> <form
 
HTML
HTML  How can we increase the row size in the grid form view of the table.I want to store the maximum 4 details of the candidate in one page of the grid table view
 
Javascript Form validation Example
Javascript Form validation Example In this section we will discuss about how... am giving a simple example for form validation using Javascript. ExampleADS_TO_REPLACE_1 In this example I have created a html file into which I have
 
html
html  How to develope a web page with Audio and vidios? give One example
 
Ads

Related Tags for HTML form example:


Ads

 
Advertisement null

Ads