knowt logo

Forms in HTML

A form is a component of a web page that has form controls, such as text, buttons, checkboxes, range or color picker controls. A user can interact with such a form, providing data that can be sent to be the server for further processing (e.g. returning the results of a search or calculation). No client-side scripting is needed in many cases, though an API is available so that scripts can augment the user experience or use forms for purposes other than submitting data to a server. The HTML form is encapsulated by the tags and all of the inputs will fall in between the opening and closing form tags. All forms start with tag and end with tag. All other form objects go between these tags. The form tag has two main properties: METHOD and ACTION. METHOD refers to post or get. The post attribute will send the information from the form as a text document. The get attribute is used mostly with search engines. We generally set METHOS=”post”. ACTION usually specifies the location of the CGI script that will process the form data. ## HTML Form Inputs HTML Form Inputs are: * Text Fields - Allows the user to input data in a one line field * Radio Buttons - Allows the user to select one option from multiple options * Checkboxes - Allows the user to select many options from multiple options * Submit Button - Allows the user to send the data Typically, the form tag will have several attributes including the name, action, and the method. The name attribute is only to differentiate one form from another on the page. The action attribute is set to the page where you will pass the data (generally, this will not be an HTML page). Finally, the method attribute will determine how you want to send the data. ### Single-Line Text Entity A single-line text entry allows the user to input a small amount of text, like a name or an email address. syntax: text to be displayed ### Multi-line Entry While you can type as much as text as you need in a single line text field, entering large quantities of text into a multi-line input field is more realistic. HTML calls these fields’ text areas. The tags used for creating multi-line text entry are. Syntex: initial text to be dispayed A WRAP attribute is available, and the default value is WRAP=”ON”. You can change wrapping to off, which will cause a horizontal scroll bar to appear at the bottom of the text area. ### Menu Buttons and Scrolling Lists Menu buttons and scrolling lists are useful when you have multiple options to choose form. Scrolling lists, otherwise known as selection lists, are similar to menu buttons, but they usually display more than one of the available options at a time. They rarely show all options, and the user is required to scroll in order to view them all. If all the options are displayed, no scroll bar is included with the list, and it may not be obvious to the user that they should select an option.

NK

Forms in HTML

A form is a component of a web page that has form controls, such as text, buttons, checkboxes, range or color picker controls. A user can interact with such a form, providing data that can be sent to be the server for further processing (e.g. returning the results of a search or calculation). No client-side scripting is needed in many cases, though an API is available so that scripts can augment the user experience or use forms for purposes other than submitting data to a server. The HTML form is encapsulated by the tags and all of the inputs will fall in between the opening and closing form tags. All forms start with tag and end with tag. All other form objects go between these tags. The form tag has two main properties: METHOD and ACTION. METHOD refers to post or get. The post attribute will send the information from the form as a text document. The get attribute is used mostly with search engines. We generally set METHOS=”post”. ACTION usually specifies the location of the CGI script that will process the form data. ## HTML Form Inputs HTML Form Inputs are: * Text Fields - Allows the user to input data in a one line field * Radio Buttons - Allows the user to select one option from multiple options * Checkboxes - Allows the user to select many options from multiple options * Submit Button - Allows the user to send the data Typically, the form tag will have several attributes including the name, action, and the method. The name attribute is only to differentiate one form from another on the page. The action attribute is set to the page where you will pass the data (generally, this will not be an HTML page). Finally, the method attribute will determine how you want to send the data. ### Single-Line Text Entity A single-line text entry allows the user to input a small amount of text, like a name or an email address. syntax: text to be displayed ### Multi-line Entry While you can type as much as text as you need in a single line text field, entering large quantities of text into a multi-line input field is more realistic. HTML calls these fields’ text areas. The tags used for creating multi-line text entry are. Syntex: initial text to be dispayed A WRAP attribute is available, and the default value is WRAP=”ON”. You can change wrapping to off, which will cause a horizontal scroll bar to appear at the bottom of the text area. ### Menu Buttons and Scrolling Lists Menu buttons and scrolling lists are useful when you have multiple options to choose form. Scrolling lists, otherwise known as selection lists, are similar to menu buttons, but they usually display more than one of the available options at a time. They rarely show all options, and the user is required to scroll in order to view them all. If all the options are displayed, no scroll bar is included with the list, and it may not be obvious to the user that they should select an option.