Skip to content
geeksforgeeks
  • Tutorials
    • Python
    • Java
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
    • Practice Coding Problems
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • HTML Tutorial
  • HTML Exercises
  • HTML Tags
  • HTML Attributes
  • Global Attributes
  • Event Attributes
  • HTML Interview Questions
  • HTML DOM
  • DOM Audio/Video
  • HTML 5
  • HTML Examples
  • Color Picker
  • A to Z Guide
  • HTML Formatter
Open In App
Next Article:
HTML Login Form
Next article icon

How To Create Registeration Form in HTML

Last Updated : 16 Oct, 2024
Comments
Improve
Suggest changes
Like Article
Like
Report

HTML Registration Form is a web-based form designed to collect user information such as name, email, password, and other details. It typically includes input fields, validation, and a submit button to register users on a website.

HTML-Registration-Form
HTML Registration Form

How to Create HTML Registration Form

  • Basic Structure: A responsive registration form is created using HTML and CSS for styling, with a simple layout and input fields.
  • Form Inputs: The form includes inputs for first name, last name, email, password (with validation pattern), contact number, and gender selection.
  • Styling: CSS is used for a modern, centered form layout with a clean design, including background color, box-shadow, and input styling.
  • Password Validation: A password pattern enforces strong security, requiring at least one number, letter, symbol, and a minimum length of 8 characters.
  • Submit Button: A styled submit button is provided with a cursor: pointer for user interaction.

Example: Implementation of a Form with multiple input tags.

HTML
<!DOCTYPE html> <html lang="en">  <head>     <meta charset="UTF-8" />     <meta name="viewport" content="width=device-width, initial-scale=1.0" />     <title>HTML Registration Form</title>     <style>         body {             font-family: Arial, sans-serif;             margin: 0;             padding: 0;             display: flex;             justify-content: center;             align-items: center;             height: 100vh;         }          .main {             background-color: #fff;             border-radius: 15px;             box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);             padding: 20px;             width: 300px;         }          .main h2 {             color: #4caf50;             margin-bottom: 20px;         }          label {             display: block;             margin-bottom: 5px;             color: #555;             font-weight: bold;         }          input[type="text"],         input[type="email"],         input[type="password"],         select {             width: 100%;             margin-bottom: 15px;             padding: 10px;             box-sizing: border-box;             border: 1px solid #ddd;             border-radius: 5px;         }          button[type="submit"] {             padding: 15px;             border-radius: 10px;             border: none;             background-color: #4caf50;             color: white;             cursor: pointer;             width: 100%;             font-size: 16px;         }     </style> </head>  <body>     <div class="main">         <h2>Registration Form</h2>         <form action="">             <label for="first">First Name:</label>             <input type="text" id="first" name="first" required />              <label for="last">Last Name:</label>             <input type="text" id="last" name="last" required />              <label for="email">Email:</label>             <input type="email" id="email" name="email" required />              <label for="password">Password:</label>             <input type="password" id="password" name="password"                    pattern="^(?=.*\d)(?=.*[a-zA-Z])(?=.*[^a-zA-Z0-9])\S{8,}$"                     title="Password must contain at least one number,                             one alphabet, one symbol, and be at                             least 8 characters long" required />              <label for="repassword">Re-type Password:</label>             <input type="password" id="repassword" name="repassword" required />              <label for="mobile">Contact:</label>             <input type="text" id="mobile" name="mobile" maxlength="10" required />              <label for="gender">Gender:</label>             <select id="gender" name="gender" required>                 <option value="male">                     Male                 </option>                 <option value="female">                     Female                 </option>                 <option value="other">                     Other                 </option>             </select>              <button type="submit">                 Submit             </button>         </form>     </div> </body>  </html> 

Output


Next Article
HTML Login Form

P

pankaj_gupta_gfg
Improve
Article Tags :
  • HTML
  • HTML-Questions
  • HTML Form

Similar Reads

    How To Create Registeration Form in HTML
    HTML Registration Form is a web-based form designed to collect user information such as name, email, password, and other details. It typically includes input fields, validation, and a submit button to register users on a website.HTML Registration FormHow to Create HTML Registration FormBasic Structu
    2 min read
    HTML Login Form
    HTML login form is used to authenticate users and grant access to secure sections of a website or application. It typically includes input fields for username/email and password, along with a submit button for logging in. Additionally, there is often an option for new users to create an account or s
    3 min read
    HTML Form Design
    HTML forms are used on websites to collect information from users. They allow users to input information such as their name, email address, password, or feedback.The <form> tag defines the form structure.Form elements like <input>, <button>, and <select> are used to collect d
    8 min read
    How to add Radio Buttons in form using HTML ?
    In this article, we will learn how to add Radio Buttons in form using HTML. We know that Radio Buttons are used to select only one option out of several options. It is generally used in HTML form. If we want to deselect any option we have to select another option in the case of a radio button. Appro
    1 min read
    How to Add a Telephone Number into a form using HTML?
    In this article, we will learn how to add a telephone number field to an HTML form. Telephone numbers have numerous advantages and are an important component of contact forms, allowing for direct communication with the user. Users can receive messages or notifications regarding the services provided
    2 min read
    How to define a form for user input using HTML5 ?
    In this article, we will learn how to create a form in a webpage by using the <form> tag. This tag is used to create form for user input. Also there are many elements which are used within form tag. Syntax: <form> Form Content... </form> Example: The following code snippet demonstr
    1 min read
    How to Prevent Buttons from Submitting Forms in HTML?
    We will use different approaches for preventing buttons from submitting forms. There are several reasons where preventing the buttons from submitting forms, i.e., if the user hasn't completed all the required form fields, or added incorrect details in the form, etc. Below are the approaches to preve
    3 min read
    How to toggle password visibility in forms using Bootstrap-icons ?
    Toggle password visibility in forms allows users to reveal or hide their typed passwords for convenience and security. Using Bootstrap icons, you can implement this feature by toggling the input field's type attribute between "password" and "text" upon icon click, revealing or hiding the password. A
    2 min read
    How to perform form validation for a required field in HTML ?
    Performing form validation for a required field in HTML ensures that a user must fill in specific fields before submitting a form. This is typically done using the required attribute, which prevents form submission if the field is left blank, ensuring proper data input.Table of ContentRequired attri
    4 min read
    How do we take password input in HTML forms ?
    In this article, we learn how to create a password input field in HTML. This can be done by using the <input> tag with type attribute which is set to the value "password". It involves sensitive information about the data of the user. The text in the input password field will be changed into bu
    1 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences