| Home | Previous Lesson: Course 3:: Session 29 :: Page 30 Next Lesson: Course 3:: Session 29 :: Page 50 |
Forms
You might have come across lot of registration forms which vendors ask you to fill out when you want to download a demo copy of the software. Forms are used to take input from the web user and then take action depending on the input. For example, to read this course, you fill out a form with your login name and password and click on the "Start" button. Whats happening when you click the "Start" button?
Your browser contacts the web server and requests it to execute a program with the specified parameters and wants the results back. The program at the web server may be written in any language. It may be a .EXE or .DLL or any other file depending on the operating system. It may even be a shell program on UNIX. The following HTML code allows you to input your name & password and then execute the "test.cgi" program at the server.
<HTML>
<HEAD>
<TITLE>Demo Page Title</TITLE>
</HEAD>
<BODY>
<FORM METHOD="GET" ACTION="test.cgi">
<p> <STRONG> Enter your Login Name:
<INPUT NAME="user_id" TYPE="Text"> </P>
<p> Enter your Password:
<INPUT NAME="password" TYPE="password">
</STRONG></P>
<CENTER><INPUT TYPE="SUBMIT" VALUE="Start Course">
<INPUT TYPE="RESET" VALUE="Clear">
</FORM>
</BODY>
</HTML>
If you save the above HTML code in a file with .HTM or .HTML extension
and open it in your browser, you will see a window as shown below:
In the HTML code a form starts with As far as buttons are concerned, there are two types of CommandButtons available in the
form. One is A browser sends requests to the server in one of the two ways, i.e., get or post. In
the above example we are using the
| Home | Previous Lesson: Course 3:: Session 29 :: Page 30 Next Lesson: Course 3:: Session 29 :: Page 50 |