Introduction:

In this article we will lean what is html form or how to use html form or how to design an html form with example.

Description:

An HTML form is a section of a html document which contains input controls such as text fields, password fields, select fields, checkboxes, radio buttons, submit button etc. An HTML form provides facility to the user to enter data that is to be sent to the server for processing.

For example: If a user want to purchase some items on internet, he/she must fill the form such as shipping address and payment method such as credit/debit card details so that item can be sent to the given address.

Let’s see, Example of HTML form:

<!DOCTYPE html>
<html>
<head>
    <title>Example of HTML form</title>   
</head>
<body>
    <form action="#">
        <fieldset>
            <legend>Form</legend>           
            <table>
                <tr>
                    <td class="tdLabel"><label for="register_name" class="label">Enter name:</label></td>
                    <td><input type="text" name="name" value="" id="register_name" style="width:160px" /></td>
                </tr>
                <tr>
                    <td class="tdLabel"><label for="register_password" class="label">Enter password:</label></td>
                    <td><input type="password" name="password" id="register_password" style="width:160px" /></td>
                </tr>
                <tr>
                    <td class="tdLabel"><label for="register_email" class="label">Enter Email:</label></td>
                    <td>
                        <input type="email" name="email" value="" id="register_email" style="width:160px" />
                    </td>
                </tr>
                <tr>
                    <td class="tdLabel"><label for="register_gender" class="label">Enter Gender:</label></td>
                    <td>
                        <input type="radio" name="gender" id="register_gendermale" value="male" />
                        <label for="register_gendermale">male</label>
                        <input type="radio" name="gender" id="register_genderfemale" value="female" />
                        <label for="register_genderfemale">female</label>
                    </td>
                </tr>
                <tr>
                    <td class="tdLabel"><label for="register_country" class="label">Select Country:</label></td>
                    <td>
                        <select name="country" id="register_country" style="width:160px">
                            <option value="india">india</option>
                            <option value="pakistan">USA</option>
                            <option value="africa">africa</option>
                            <option value="china">Japan</option>
                            <option value="other">other</option>
                        </select>
                    </td>
               </tr>
                <tr>
                    <td colspan="2">
                        <div align="right">
                            <input type="submit" id="btnregister" value="register" />
                        </div>
                    </td>
                </tr>
            </table>
        </fieldset>
    </form> 
</body>
</html>  


 Let's check live example

0 comments


Leave a comment

Make sure you enter the (*) required information where indicated. HTML code is not allowed.

You may also like