welcome to tutorialfamily

html form

HTML form defines in form tag.

It is used for collect the data from the visitor or user.

menus, password fields, field, radio buttons, checkbox, submit button are input type of HTML form.

text fields, drop-down menus, checkboxes, radio buttons, textarea fields are element of HTML form.

HTML form

form syntax
<form action=”#”></form>. it is used for collect the data from the user.

syntax



<!DOCTYPE html>
<html>
	<head>
		<title>
			form demo
		</title>
		</head>
	
<body>
    <form action="#">
		…..
	</form>
</body>
</html>


HTML Form element

  • The <form> is defines HTML form
  • The <input> is defines input type HTML form
  • The <option> is defines drop-down list type HTML form
  • The <textarea> is defines text-area type HTML form
  • The <select> is defines multiline select type HTML form.
  • The <label> is defines field label HTML form
  • The <button> is defines input type element HTML form
  • The <legend> is defines caption of fieldset of HTML form.
  • The <fieldset> is defines group element type HTML form
  • input type element

    input type element
    <input>. it is used for collect the name data from the user. it has default value up to 20 character. it is used single line data collect from the user.

    example

    
    
    <!DOCTYPE html>
    <html>
    	<head>
    		<title>
    			input form demo
    		</title>
    		</head>
    	
    <body>
        <form action=”#”>
    		your name:<input type="text" name="yourname">
    		your surname:<input type="text" name="surname">
    		<input type="submit">
    	</form>
    </body>
    </html>
    
    
    

    select type element

    select type element
    <select name=”car”>. select type used for single data collect from the given list by user.

    example

    
    
    <!DOCTYPE html>
    <html>
    	<head>
    		<title>
    			select type form demo
    		</title>
    		</head>
    	
    <body>
    	<form action="#">
    		<select name="car">
    			<option value="Audi"> Audi </option >
    			<option value="Volvo"> Volvo </option >
    			<option value="Verna"> Verna </option >
    		</select>
    		<input type="submit">
    	</form>
    </body>
    </html>
    
    
    

    textarea element

    textarea element
    <textarea name=”info”>…..</textarea>. It is used for multiline text.

    example

    
    
    <!DOCTYPE html>
    <html>
    	<head>
    		<title>
    			textarea type form demo
    		</title>
    		</head>
    	
    <body>
    	<form action="#">
    		<textarea name="info" height="150px" width="200px"></textarea>
    		<input type="submit">
    	</form>
    </body>
    </html>
    
    
    

    legend & fieldset element

    legend & fieldset element
    <fieldset>…..</fieldset>. fieldset is defines group information and legend is define caption of group information.

    example

    
    
    <!DOCTYPE html>
    <html>
    	<head>
    		<title>
    			fieldset form demo
    		</title>
    		</head>
    	
    <body>
    	<form action="#">
    		<fieldset>
    			<legend>
    				data information
    			</legend>
    			your name:<input type="text" name="yourname">
    			your surname:<input type="text" name="surname">
    			<input type=”submit”>
    		</fieldset>
    	</form>
    </body>
    </html>
    
    
    

    Our Content