In this example, we will use a form with several input boxes to get information from the user, and then use that information to generate a web page.

Click here to see the example.

Here is the source code:

<HTML>
<HEAD>
</HEAD>
<BODY>
In this example, we will use a form with several input boxes to
get information from the user, and then use that information
to generate a web page.
<BR>
<P>
<FORM NAME="myform">
What is your first name?
<INPUT TYPE="text" NAME="firstname">
<BR>
What is your last name?
<INPUT TYPE="text" NAME="lastname">
<BR>
<INPUT TYPE="button" VALUE="Press Here"
onClick="document.write('Congratulations ' + document.myform.firstname.value + ' ' + 
document.myform.lastname.value + '<BR>');">
</FORM>
</BODY>
</HTML>
The action taken when the button is pressed is to have this information used to generate a web page, by using document.write.