banner
Welcome to HTML.co.uk, the number one resource for all news, information, and happenings regarding HTML.

Updates: HTML.co.uk has just been relaunched. Subscribe to our RSS Feed to stay on top of HTML news and techniques.
Jul
2nd

Different Controls used in HTML Forms

Author: Editor | Files under HTML Tutorials
Tags for this article: , , , , ,

The end user interacts with the HTML forms via various kinds of controls such as text boxes, command buttons, option lists, checkboxes etc. Each and every option is intended to execute a specific type of command and generates the relevant output. The functions of every control is different form one another. Web developer can use only few of them or all of them depending upon his needs and keeping in mind the ultimate objective of embedding the form in the web site.

Every control is given a name so that the scripts can easily identify it. There are two types of values of the controls. One is the initial value which indicates the default status of the control at the time the form is loaded and the other one is current value which determines the current status of the control. For example: The initial value of a text box is blank, but when the user will enter his name into it its current value will change. These two values are important as they tell the scripts that whether the form has been modified or not. Every time the user resets the form all the control’s values get changed into their initial state.

Different types of controls used in the form are:

• Command Buttons
• Check Boxes
• Radio Buttons
• Drop Down Menus
• Text Boxes
• File Select
• Hidden Controls
• Object Controls

Command Buttons: Command buttons are used when the user wants to submit the information or he wants to reset the values embedded in the form. There are three types of command buttons i.e. submit button, reset button and push button. The submit button is used when the user wants to submit the details entered into the form. Reset button is pressed when the user wants to set all the values to their default state. Apart from these there can be other types of command buttons also which can be used for specific purposes. Those buttons are called push buttons.

Check Boxes: Check boxes are squared shaped boxes which are used to select one or more than one options simultaneously.

Radio Buttons: Radio buttons are circle shaped buttons which unlike the check boxes allow you to select only one option at a time within a given set of alternatives.

Drop Down Menus: These menus are used as alternative to radio buttons and check boxes. If the list of the options is very long, then using check boxes and radio buttons will take large space and the look of the web site will deteriorate. In order to solve this drop down menus is used in which infinite countless number of options can be accommodated without increasing the size of the menu.

Text Boxes: Text box is used to enter some textual data in the form such as your name. Text box cannot contain various lines of text. It is limited to a certain number of characters. If you want to give the user more space to write then the ‘TEXTAREA’ option can be used.

File Select: This control allows the user to select files so that their contents may be submitted with a form.

Hidden Controls: These kinds of controls are not shown to the end user. It is only in the background to facilitate data exchange between the client and the server.


Jun
19th

Common Gateway Interface (CGI)

Author: Editor | Files under HTML Tutorials
Tags for this article: , , , , , ,

Today, almost every web site contains highly interactive and dynamic web pages in order to make internet more captivating and to support e-commerce. Users can perform various tasks on the World Wide Web like chatting, polling, blogging, shopping, gaming, audio/video streaming and much more. In order to interact with the user in real time, web browsers need to connect with web servers frequently especially when a user is doing online banking. In that case the customer’s data is updated instantly. There is no space for delay or any other kind of web error. So, in order to facilitate such a high level of user interactivity on the internet, CGI (Common Gateway Interface) was developed. CGI is a standard which specifies the way for web servers to communicate wit the external programs/scripts and vice versa. CGI allows the information to effectively travel between the web browser, web server and any other external script or application (applets) which is needed to perform some specific tasks on the web.

CGI fully supports the functioning of dynamic pages. In fact the DHTML is of no use without CGI standards. CGI can be used to perform various dynamic tasks such as a hit counter, online banking, online polling, video conferencing etc. It has become very popular now a days because of the following reasons:

1) CGI is the quickest way to support dynamic pages.
2) CGI standards are supported by most of the web browsers. Thus there are no compatibility issues.
3) CGI codes are available easily. There are lot of codes each written for a specific purpose.

The basic CGI programs can be easily written in C, C++, Shell scripts and Perl language. Every CGI program has its own ‘Method’ of communication, processing and functioning. In total there are three methods which can be used:

1) GET Method
2) POST Method
3) HEAD Method

The GET Method is used you want that the CGI program should receive the data/query. After receiving the query data the CGI program interprets it and executes the expected tasks. GET Method should be used when you want to retrieve the data from the web server which you will not change. On the contrary, POST Method is used when you want to send data to the web server which will change the existing one or when you want to send large amount of data to the CGI program.

There is one more CGI Method called HEAD. It is similar to the GET Method, but while using the HEAD the web server only sends the HTTP headers instead of the actual data to the web browser.

CGIs are widely used for web site linking. It facilitates the search capability within a website. For example; at yahoo.com one can search for any resource in the search bar. Here the yahoo’s web page acts as a front end panel where the user can specify the search criteria and at the backend the web page is linked with the databases via CGI.

Now a days, as the Java language is also being used for web sites, there are chances that CGI will become obsolete after sometime because Java provides better options and its processing time is less than CGI programs.