HTML Forms
HTML Forms
HTML forms are used to collect user input. They allow users to enter data which is sent to the
server for processing. Forms can contain various types of input fields such as text boxes,
checkboxes, radio buttons, submit buttons, and more.
The syntax for creating a form in HTML is:
<form action="server-side script" method="post/get">
<!-- form elements go here -->
</form>
The action attribute specifies the URL of the server-side script that will handle the form data.
The method attribute specifies how the form data will be sent to the server. The two possible
values for this attribute are post and get.
Input Fields: There are different types of input fields in HTML forms. Some of the commonly
used input fields are:
1. Text Input: <input type="text" name="username">
2. Password Input: <input type="password" name="password">
3. Checkbox: <input type="checkbox" name="remember">
4. Radio Button: <input type="radio" name="gender" value="male">
5. Select Box:
<select name="cars">
<option value="volvo">Volvo</option>
<option value="audi">Audi</option>
<option value="bmw">BMW</option>
</select>
6. Textarea: <textarea name="message"></textarea>
7. Submit Button: <input type="submit" value="Submit">
Form Attributes
There are various attributes that can be used to modify the behavior of a form. Some of the
commonly used form attributes are:
1. autocomplete: Specifies whether or not the browser should autocomplete input values.
2. enctype: Specifies the content type of the data sent to the server.
3. novalidate: Specifies that the form should not be validated when submitted.
4. target: Specifies where to display the response that is received after submitting the
form.
<html>
<head>
<title>Global Academy</title>
</head>
<body bgcolor="sky-blue" margins="100px">
<h2>This is the normal Form</h2>
<form >
<label for="First Name">First Name:</label>
<input type="text" name="First name" id="firstname"><br><br>
<label for="Address">Address:</label>
<input type="text" name="address" id="address"><br><br>
<label for="Password">Password:</label>
<input type="password" name="Password" id="password"><br><br>
<label for="gender">Gender:</label>
<select name="gender" id="gender">
<option value="">Select gender</option>
<option value="male">Male</option>
<option value="female">Female</option>
<option value="other">Other</option>
</select><br><br>
</form>
</body>
</html>
Introduction to HTML 5
HTML 5, or Hypertext Markup Language version 5, is the latest version of the HTML standard
for creating web pages and web applications. It was developed by the World Wide Web
Consortium (W3C) and introduced in 2014.
HTML 5 includes a number of new features and improvements over previous versions of
HTML, including:
1. Better support for multimedia: HTML 5 includes built-in support for audio and video
playback without requiring third-party plugins like Flash. This makes it easier to create
multimedia-rich websites and web applications.
2. Improved semantic markup: HTML 5 includes new semantic markup elements that allow
developers to better describe the structure and content of a web page, making it easier for
search engines and screen readers to understand the page's content.
3. Mobile-friendly design: HTML 5 includes features that make it easier to create web pages
that are optimized for mobile devices, including responsive design, which allows web pages
to adjust their layout and content based on the size of the device screen.
4. Improved forms: HTML 5 includes new form input types and attributes that make it easier
to create more complex and user-friendly forms, including support for date pickers, color
pickers, and range sliders.
5. Offline web applications: HTML 5 includes support for offline web applications, which
can cache web pages and other resources so that users can access them even when they are
not connected to the internet.
Overall, HTML 5 provides web developers with a more powerful and flexible set of tools for
creating websites and web applications that are more multimedia-rich, accessible, and mobile-
friendly.
Embedding Audio
HTML 5 supports <audio> tag which is used to embed sound content in an HTML or XHTML
document as follows:
<audio controls autoplay>
<source src="example.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
Embedding Video
<video controls>
<source src="myvideo.mp4" type="video/mp4">
Your browser does not support HTML5 video.
</video>
Domain name
A domain name is a unique address that identifies a website on the internet. It consists of a
name (e.g., google) and a top-level domain (e.g., .com, .org, .net) separated by a dot. Domain
names are used to help users easily find and access websites, and they also play a role in
branding and marketing for businesses and organizations. Domain names are registered and
managed through domain name registrars, which allow individuals and businesses to purchase
and control their own domain names.
Web hosting
Web hosting refers to the process of storing and publishing a website or web application on the
internet. When you create a website, it consists of files such as HTML, CSS, JavaScript, and
images, which need to be stored on a server in order to be accessible online.
Web hosting companies offer services that enable individuals and organizations to publish their
websites on the internet. These companies provide servers, storage space, and other resources
necessary to make a website accessible to visitors.
When you sign up for web hosting, you are essentially renting space on a server to store your
website files. The web hosting company manages the server hardware and software, ensuring
that your website is available to visitors 24/7.
Web hosting plans can vary depending on the needs of the website owner. For example, a small
personal blog might require only basic web hosting with limited storage and bandwidth, while
a large e-commerce site might require dedicated hosting with more resources and higher
security features.
In summary, web hosting is the process of storing and publishing a website or web application
on the internet, and web hosting companies provide the necessary resources and support to
make this possible.