Home Techindex Html HTML form example

 
 

HTML form example
Posted on: March 28, 2011 at 12:00 AM
Advertisement
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.

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 you how to performance form validation using JavaScript. The HTML <form>...; HTML Form Example </title> <script type="text/javascript">
 
HTML form examples
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 code? Thanks   Hi, Please see the HTML form example page. Thanks
 
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
 
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
 
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...;  Draw the HTML form <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
 
Opening a file in a HTML form
Opening a file in a HTML form In this example, you will first see that a form... separately.  First create a HTML form and call the php action file to open...); } } ?> Making a HTML action form Draw a  table for browsing and browse
 
HTML Post Form
an example from HTML Post Form. In this Tutorial, the code explain you a post... HTML Post Form       The HTML process the submission of form in two different ways. In HTML
 
HTML
will learn about the basic tags of a HTML Form and their attributes... Field By using form in HTML, users are allowed to enter or select... Button in HTML are type of input form, which allows a user to select any one option
 
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 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... a HTML form and send the data to PHP file get method. 
 
HTML Code for registration form
HTML Code for registration form Here is an example of Registration form using HTML. Here a programmer can display as many "Text Field" as he/she wants... form their is a "ADD" button behnd which any desired link can be used. Once
 
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... in Html is used to submit form data to the page mentioned in the ACTION attribute
 
HTML Form data into .CSV?
HTML Form data into .CSV?  how to store data from html form to csvfile in java
 
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
 
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, radio button, Reset button and Submit Form button. We have used Reset button
 
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 form - Java Beginners
html form  Hi
 
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
 
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 - 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
 
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  how we can give the form actions in html after register button in the login page
 
HTML
HTML  How do we create a link? What are the three types of form tags in HTML
 
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
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
 
HTML
HTML  Hi, What is the full form of HTML? Thanks   Hi, The HTML stands for HyperText Markup Language. HTML is used to create webpage for world wide web. Web pages are accessed by web browsers and then shown
 
convert this html form to jsp
convert this html form to jsp  <html> <head> <script...;/tr> <form name="VillageDetailsForm" action="AddVillage.jsp" method... includes html tags so you may change an extension. Please visit the following links
 
HTML form methods GET and POST
HTML form methods GET and POST  What is the difference between the HTML form methods GET and POST
 
Developing Forgot Password Form
;html:form action="/userforgetpassword" method="post">... Username and Password</html:submit></td> The form validation...;td><html:form action="/userforgetpassword" method="post"
 
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
 
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
 
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
 
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
 
storing date from html form to oracle 10g using servlet
storing date from html form to oracle 10g using servlet  i have following html form from where date,month and year is retrieved separately.. <... this date month year from html form into oracle 10g database where i have
 
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
 
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. Example In this example I have created a html file into which I have created a three
 
html
html   HTML document with Javascript to count the number of vowels... is the code ..I hope this will solve your problems : <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <TITLE>
 
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
 
Html form validation using jquery
Html form validation using jquery  Hi i am using form with html. Form elements like textbox, radio,checkbox,listbox i was used now how to validate the elements using submit jquery option
 
Advertisement

Related Tags for HTML form example:


Advertisements Advertisements
 

 

 

DMCA.com