Tierra  Zemlak

Tierra Zemlak

1605144254

A deep dive into the HTML form input element

This post breaks down the HTML form input element, explains how they works, and shows you how to best apply them in various use cases. Get a complete run-down of the HTML form input element in this comprehensive tutorial.

According to the MDN Web Docs, the HTML <form> element represents a document section containing interactive controls for submitting information. Whenever we, as web developers, require information from our users, we present them with a <form> element.

On a high-level, it could be the commonplace login form with the user’s email address and password, or a security enhanced two-factor authentication (2FA) form to double check sensitive operations. Either way, forms represent a contractual interface between our requirements and the user’s possessions.

The basic building blocks of the <form> element are its controls. These controls range from basic interactive elements like the <input>, to structural elements like the <fieldset> used to group several other controls. Others include controls like <button> for performing a click action, and <label> for describing other controls.

Of all the controls, the input is perhaps the most variant and most used. Or as documented on MDN, it is one of the most powerful and complex in all of HTML elements due to the sheer number of combinations of input types and attributes.

A short note about the complexities of the <input> element

To understand the true complexity behind <input>s is to step back to understand the primary purpose of web forms: to get information from the user, but more importantly, to foster interaction between users and websites, and even more fundamentally between Human and Computer. This kind of interaction is sufficiently complicated and complex enough to have given rise to the multidisciplinary field of Human-Computer Interaction (HCI).

The crux here is that when a user interacts with a website, they are basically performing one of the basic CRUD (Create, Read, Update, Delete operations Query, Mutation, and Subscription in GraphQL. And when we present the user with a form, we are basically interacting with them through a “dialogue system”.

When speaking of HCI in relation to web forms, we are often led down the road of usability and security. We often do not need to augment the default form elements as many websites do, neither do we need to manually enhance validation, but attempting to provide a generic API will not serve the best, specific, and secure needs of everyone.

As you work through this dialogue system, you’ll notice that the type of data you are trying to get from the user depends on what type of <input> you use, and as you’ll learn, data type and input type are sometimes mutually exclusive.

Nevertheless, the flexibility of <inputs>s still shine above other form controls. For most every interaction, there’s often an <input> that can get you the type of data you want from the user. It also has some sensible defaults that you do not have to re-wire, like the password input where the user input is already obscured. And there are times when you need to extend the functionality of certain inputs to do just as you want them to.

The flexibility of the <input> control makes it powerful but also makes it complex, and when coupled with the fact that it is one of the controls used to achieve the goal of a web form, you can expect a plethora of ways to do it right and wrong.

<input> types

Similar to every other HTML element, the <input> element has a number of attributes that can be used to configure it to a particular need. Of all the available attributes, the type attribute is the most important because it gives an <input> its identity. When not explicitly specified or when not supported, or when a non-existing type is specified, the type defaults to text. That is, <input> or <input type="undefined"> is technically equivalent to <input type="text">

Technically, all inputs share the HTMLInputElement interface and, by extension, have the same exact set of attributes.

However, these attributes are functionally dependent on the type of the input they’re used with. For example, both the text and checkbox input have the autocomplete attribute, but while it works on a text input, it is ignored on a checkbox.

Also, an <input>’s functionality, design, and availability is dependent on the device and user agent.

Take the telephone input ( <input type="tel">) for example. It displays a telephone keypad in supported devices with on-screen/virtual keypads like a phone, and has no practical advantage over the text input when used on a device without an on-screen keypad.

Speaking of virtual keypads, how you configure or customize them and the type you use can also result in differences in what you see.

Apart from the type attribute, there are other important attributes like required(indicating that the user must provide a value for that control before the form can be submitted) or theplaceholder (representing a hint describing the <input>).

But the type attribute is the most important, not just because it gives an <input> its identity, or because they contribute to that sheer number of combinations that makes <input>s complex, but also because of the functional dependence attributes have on them.

#html #web-development #programming #developer

What is GEEK

Buddha Community

A deep dive into the HTML form input element
Hertha  Mayer

Hertha Mayer

1595425063

All You Need To Know About HTML Forms

Forms are ways of providing information, and so is an HTML form, but rather on a web page, using a browser. As much as a normal paper form contains fields to fill in your details, and after that, you can submit to someone in charge, so HTML forms also provide inputs fields, which serve as fields that allow you to fill in your data and submit to the server for some processing and back to the person-in-charge (the developer).

The above things are however not new to a web developer, as millions of forms are being filled on websites daily. But whether you are new to the game or a professional. This tutorial tells all that you need to know about HTML Forms, including HTML form action, form methods, HTML form encoding types, and form processing.

Let’s dive into the details!

HTML Form Action

HTML Form actions point to where the form should be submitted. This is done with the action attribute. The value of the action attribute is typically a URL to an external or internal page.

Example

<form action="https://example.com" method="GET"> ... </form>

HTML Form Methods

Form methods tell the browser to send the users’ data, and in other ways tells the server how to process the provided information by your user. This is possible in HTML form by using the method attribute. This attribute can either be "GET" or "POST" depending on the purpose of the form.

The GET Method

The GET method tells the browser to include all the form data in the URL after submitting. Each piece of data appears by sending the URL in the action attribute, followed by ? followed by key=value. This method should be used for processing less-sensitive data, such as name search or getting content per user (/?username=Bob), and should not be used for processing sensitive information such as passwords. We will discuss a method suitable for processing sensitive data in the next section. Let’s use a live example.

Example: GET Method

<form method="GET" action="search.php">  
<input type="search" name="key" /> <input type="submit" value="Search" name="submit" /> </form>   

When this form is submitted, the processed URL will result in something like /search.php?key=hello&submit=Search. You can see that all users’ information is displayed on the URL in the format of key=value. The example stands as a good reason for you to know why it is bad and not advisable to include sensitive information on a GET form. Let’s look into a bad way of using GET method.

Note

The key is the value provided in the attribute of each form field, therefore the name attribute is important in HTML form processing.

Wrong Example: POST Method

Take a look at the example above, so for example, assuming user enters the username ola and password and clicks on login, this will result to a URL: /login.php?username=ola&password=password&submit=Login, revealing sensitive information on the browser’s URL, this can be used by hackers to get vital information, and get access to personal accounts.

#html-fundamentals #html #html5 #tutorial #html-forms #guide-to-html-forms #latest-tech-stories #php

Ava Watson

Ava Watson

1595318322

Know Everything About HTML With HTML Experts

HTML stands for a hypertext markup language. For the designs to be displayed in web browser HTML is the markup language. Technologies like Cascading style sheets (CSS) and scripting languages such as JavaScript assist HTML. With the help of HTML websites and the web, designs are created. Html has a wide range of academic applications. HTML has a series of elements. HTML helps to display web content. Its elements tell the web how to display the contents.

The document component of HTML is known as an HTML element. HTML element helps in displaying the web pages. An HTML document is a mixture of text nodes and HTML elements.

Basics of HTML are-

The simple fundamental components oh HTML is

  1. Head- the setup information for the program and web pages is carried in the head
  2. Body- the actual substance that is to be shown on the web page is carried in the body
  3. HTML- information starts and ends with and labels.
  4. Comments- come up in between

Html versions timeline

  1. HTML was created in 1990. Html is a program that is updated regularly. the timeline for the HTML versions is
  2. HTML 2- November, 1995
  3. HTML 3- January, 1997
  4. HTML 4- December, 1997; April, 1998; December, 1999; May, 2000
  5. HTML 5- October, 2014; November, 2016; December, 2017

HTML draft version timelines are

  1. October 1991
  2. June 1992
  3. November 1992
  4. June 1993
  5. November 1993
  6. November 1994
  7. April 1995
  8. January 2008
  9. HTML 5-
    2011, last call
    2012 candidate recommendation
    2014 proposed recommendation and recommendation

HTML helps in creating web pages. In web pages, there are texts, pictures, colouring schemes, tables, and a variety of other things. HTML allows all these on a web page.
There are a lot of attributes in HTML. It may get difficult to memorize these attributes. HTML is a tricky concept. Sometimes it gets difficult to find a single mistake that doesn’t let the web page function properly.

Many minor things are to be kept in mind in HTML. To complete an HTML assignment, it is always advisable to seek help from online experts. These experts are well trained and acknowledged with the subject. They provide quality content within the prescribed deadline. With several positive reviews, the online expert help for HTML assignment is highly recommended.

#html assignment help #html assignment writing help #online html assignment writing help #html assignment help service online #what is html #about html

Alisha  Larkin

Alisha Larkin

1617789060

HTML Tutorial For Beginners

The prospect of learning HTML can seem confusing at first: where to begin, what to learn, the best ways to learn — it can be difficult to get started. In this article, we’ll explore the best ways for learning HTML to assist you on your programming journey.

What is HTML?

Hypertext Markup Language (HTML) is the standard markup language for documents meant to be displayed in a web browser. Along with Cascading Style Sheets (CSS) and JavaScript, HTML completes the trio of essential tools used in creating modern web documents.

HTML provides the structure of a webpage, from the header and footer sections to paragraphs of text, videos, and images. CSS allows you to set the visual properties of different HTML elements, like changing colors, setting the order of blocks on the screen, and defining which elements to display. JavaScript automates changes to HTML and CSS, for example, making the font larger in a paragraph when a user clicks a button on the page.

#html #html-css #html-fundamentals #learning-html #html-css-basics #html-templates

ashika eliza

1625652623

HTML - A Complete Guide to Master the Top Programming Language

In this era of technology, anything digital holds a prime significance in our day-to-day life. Hence, developers have submerged themselves to create a major impact using programming languages.According to Statista, HTML/CSS holds the second position (the first being Javascript), in the list of most widely-used programming languages globally (2020).Interested to learn this language? Then head on to this tutorial and get to know all about HTML! Plus we have added numerous examples such that you can learn better! So happy learning!
html for beginners

#html #html-for-beginners #html-tutorials #introduction-to-html #learn-html #tutorials-html

Types, Effects and Attributes

HTML Button Tag – Types, Effects and Attributes

In this article, we are going to learn HTML Button Tags. So let’s start!!!

HTML Button

HTML Button

The

#html tutorials #html button #html button attributes #html button element #html button tags #html