Skip to main content

HTML forms

HTML Forms

HTML is a web page markup language which designs your static web pages.The most common thing we see in a web page is a form.We normally signup for various services, comments on articles, discussion forum, polls and many other services.These all are a type of form which one can easily create using the HTML "form" tag.HTML forms are used to collect different kinds of user input.
A form is an area that can contain form elements. Form elements are elements that allow the user to enter information in a form (like text fields, text area fields, drop-down menus, radio buttons, check boxes, and so on). But HTML forms are only static.Means they can send the information but can't check whether the information is valid or not.
To implement the form validation, you'll have to use a scripting language such as javascript, vbscript, php etc.Form validation is an important thing but form structure is another important thing which we can do using HTML only.


form and input Tags

form tag is used to declare a form in which we can place elements which will let the users to input their information.

Format

<form>
....input elements.... </form>


"input" tag is used to create different elements.In this article we'll only focus on text fields.For other type elements see our type of html form elements article.
A general form looks like this



The form created above does not send the entered information to anywhere.The default text field width is 20 characters but you can adjust it using the "width" attribute.To send the information to a specific page or location you'll need to use the "action" and "method" attributes.To read about these go to form attributes.


Now we'll discuss the form we created above.
  • The first thing is :- declare the form using the "form" tag.
  • Then create input field by using the "input" attribute.This goes like this...."input type='__' name='__' value='__'"
  • After creating desirable number of fields, close the form tag by "/form".
In the "type" attribute, set the type of field, which is "text" in our case i.e. "type=text".
In the name attribute, set the name of the field, which is "Name" in our case i.e. "name=Name".
In the value attribute, set the value to be displayed in the field which you can further edit while filling a form

This is a introduction to html forms.To further read about forms check our various posts.

Comments

Popular posts from this blog

Image Search Engine Using Python

Images provide a lot more information than audio or text. Image processing is the prime field of research for robotics as well as search engines. In this article we will explore the concept of finding similarity between digital images using python. Then we will use our program to find top 10 search results inside a dataset of images for a given picture. It won't be as good as google's search engine because of the technique we will be using to find similarity between images. But what we are going to make will be pretty cool. So lets start. Setting up the Environment Our Algorithm How the code looks Lets build the GUI Additional Techniques Setting up the Environment The code we are going to write requires a few tools which we need to install first. I will try to be as precise as i can and if you get stuck into installing some tool then you can drop a comment below and i will help you sort out the problem. So here are the tools and the steps to install ...

Cordova viewport problem solved

Include the viewport settings in Cordova If you are facing the auto zooming problem of cordova then go read on the full article. Cordova actually ignores the viewport meta tag which causes the pixel density problem. So we need to tell cordova that viewport tag is equally important as other tags. To do this, we need to add some code to a file which is specify in the article. Corodva messes with pixels If you are using the latest cordova version or creating the cordova app for latest android versions then you may have faced the zoom malfunctioning.I also faced it when creating an app. Many of you may have already searched the web and found the answer of changing the meta tag attributes to get it working. But adding target-densitydpi=medium-dpi does not solve the problem for latest android versions. It may work for gingerbread but not for kitkat and others. So the final solution which i found was one of the stackexchange answer but rarely found. So i am gonna two things here, i ...

Authentication System : Basic Design

Being a system administrator, it is our main concern to protect users' data from theft and corruption. Regarding theft, we focus in building a sophisticated but secure authentication system which can fulfill all the basic needs we discussed in the last article . In the previous 2 articles, we learned about authentication and authorization. Also we understood the complications in building a secure system which can prevent tresspassing. But we have not code anything yet to build something. So in this article we will be designing an authentication system which will provide the functionalities we want and which will help us understand how the tech giants like google have taken security to another level. We will be writing code in php but the same applies to other languages also. What we'll be using Blueprint Building the system Running the system Additional Care What we'll be using Lets see what are the languages we will be using and database plus som...