Forms

  • Forms are used to get data from the webpage user like registration data, comments, and messages.
  • HTML provides the form fields design, but return processing of form data to server-side scripting languages

 

Example:


<!doctype html>   
<html>
<head>
    <meta charset="utf-8">
    <title>Simple Form With Radio Options</title>
</head>
<body>
    <form action="myWebPage.aspx" method="pst">
        <h1>Master Program Inquiry:</h1>
        <p><label>Student Name: <input type="text" required maxlength="50">
           </label></p>
        <p><label>Email: <input type="email" required  maxlength="50">
           </label></p>
        <p><label>Telephone: <input type="tel" required  maxlength="50">
           </label></p>
        <fieldset>
            <legend>Please send my graduation program requirments for 
            the following Department:</legend>
            <p><label>
                <input type="radio" name="Department">
                Computer Scince</label></p>
            <p><label><input type="radio" name="Department">
                Management Information Systems</label></p>
            <p><label><input type="radio" name="Department">
                Software Engineering</label></p>
            <p><label><input type="radio" name="Department">
                Information Technology</label></p>   
        </fieldset>
        <br />
        <formset>
            <legend>Additional Information Needed:</legend>
            <p><label><input type="checkbox" name="fees">
                Program  Fees</label></p>
            <p><label><input type="checkbox" name="accommodation">
                Accommodation  Availability</label></p>
        </formset>
        <h2>Comments:</h2>
        <p><label><textarea name="comments" id="" cols="30" rows="10" maxlength="200" >
                  </textarea></label></p>
        <p><button type="submit">Submit</button></p>
    </form>
</body>
</html> 

 

The result will be something like: