Close Menu
    Facebook X (Twitter) Instagram
    Oixiesoft
    • Home
    • Services
      • WordPress Malware Removal
      • Fix WordPress Errors
      • WordPress Website Development
    • Articles
    • Contact
    Oixiesoft
    Home»Tutorial»html»HTML Forms
    html

    HTML Forms

    Editorial StaffBy Editorial StaffUpdated:April 26, 2022No Comments2 Mins Read
    Share
    Facebook Twitter LinkedIn Pinterest Email

    HTML Forms are required when you want to collect user data.
    Syntax of using <form> element is as follows:

    Html Form elements

    There are lots of Form elements that are used to take information from the user given below:

    • text fields,
    • <label>,
    • drop-down menus,
    • radio buttons,
    • checkboxes, etc.

    For example signup details: name, email, phone no, etc.

    <!DOCTYPE html>
    <html>
    <body>
    
    <h2>HTML Forms</h2>
    <form action="#">
      <label for="fname">Name:</label><br>
      <input type="text" id="name" name="name" value="Camila"><br>
      <label for="">Email:</label><br>
      <input type="text" id="email" name="email" value="camila@gmail.com"><br><br>
      <input type="submit" value="Submit">
    </form> 
    
    </body>
    </html>
    

    Output




    The <input> Element

    Observing is the list of attributes for the <input> tag.

    • type: It shows the type of input control. This element is also used to create other form controls such as checkboxes, radio buttons, and submit.
    • name: This attribute is used to give the name part of the name/value pair that is sent to the server.
    • value: It provides an initial value for the text input field that the user will see when the form loads.
    • size: It defines the width of the text-input field in terms of characters.
    • maxlength: The maxlength defines the maximum number of characters a user can enter into the text box.

    Example

    <!DOCTYPE html>
    <html>
    <body>
    
    <h2>How to use <input> attributes</h2>
    
    <form>
      <input type="radio" id="htm" name="fav_language" value="HTML">
      <label for="html">HTML</label><br>
      <input type="radio" id="php" name="fav_language" value="PHP">
      <label for="php">PHP</label><br>
    <input type="checkbox" id="fruit" name="apple" value="Apple">
      <label for="fruit"> I have a Apple</label><br>
    <input type="submit" value="Submit">
    </form> 
    
    </body>
    </html>
    
     







    Read More

    HTML Form Attributes

    Share. Facebook Twitter Pinterest LinkedIn WhatsApp Reddit Tumblr Email
    Editorial Staff

    Related Posts

    CodeIgniter vs Laravel: A Detailed Side-by-Side Comparison

    Python Arrays

    Python Lambda

    • HTML Introduction
    • HTML Editors
    • HTML Tags
    • HTML Attributes
    • HTML Headings
    • HTML Paragraphs
    • HTML Comments
    • HTML Styles
    • HTML Text Formatting
    • HTML Colors
    • HTML links
    • HTML Images
    • HTML Styles – CSS
    • HTML Tables
    • HTML Lists
    • HTML Forms
    Services
    • Web Development
    • Mobile Application Development
    • WordPress Malware Removal Service
    • Website Design
    • WordPress Development
    • Magento Development
    • Shopify Development
    • SEO Services
    Blog
    • How to Fix the Error Establishing a Database Connection
    • Ping List WordPress
    • How To Fix Japanese Keyword Hack
    • How to remove Malware from WordPress
    Hire Developers
    • Hire WordPress Developer
    • Hire Shopify Developer
    Contact Info
    • Oixiesoft Technologies
      A-40, Block A, I thum Tower, Sector 62, Noida
    • sales@oixiesoft.com
    • Privacy Policy
    • About Us
    • Contact Us
    © 2025 OixieSoft Technologies

    Type above and press Enter to search. Press Esc to cancel.