KidsLovePC Contact Us
  Home   PHP  Graphics ASP  JavaScript   J2EE  HTML  JAVA   Swing   Webtip  Forums  Lyric  Free sheet music  Ringtones

Getting information from the user

Obtaining information from the user can be accomplished using the HTML form. Form processing can be broken down as follows:

  • <FORM> tags specifies the start of a from
  • define fields, buttons, etc, which captures user information.
  • submit button which sends the from to another form (asp or cgi)
  • The action ASP file which reads the passed information and acts on it.

Example: Spring break


<html>
<head>
<title>Base ball schedule</title>
<head>
<body>
<h1>Base ball schedule</h1>
<h2> Each team will meet at a different time and place</br>
Please provide the name of your team<br></h2>
<form action="baseballs.asp" method=post>
Please type your team name here:
<p><Input type="text" name="team"></p>
<p> <Input type="reset" value="Reset Name"></p>
<p><Input type="submit" value="Click here to send this information"></p>
</form>
</body>
</html>

How it works:

The <form> tag signals the beginning of a form. The action="baseballs.asp" tells the browser where to send the form to. Method=post specifies how the information is to be retrieved by the destination program.
Controls used: text, named team.
Submit button, submit button, Caption set to Click here to send this information"
Reset button:

The user types the team name into the textbox named team, then presses the Submit button. The information in the form is sent to baseballs.asp which retrieves the information.

Passing the information to a another program baseballs.asp:

Example: retrieve the information from the form and display it using the response object.

Save the following code to baseballs.asp. It deals request from the above form

<html>
<head>
<title> Baseball Notice</title>
</head>

<body>
<h1>Base ball schedule</h1>
<h2>Thank you for registering as a member of the
<%
Dim strTeam
strTeam=Request.Form("team")
Response.write strTeam
Response. write strTeam+" meet at ball field no.6"
%>
</h2>
</body>
</html>

How is works:

The above script is executed when the user presses the Submit button. It retrieves the department information by requesting it from the form: Request.From("team") where team is the named of textbox where the user entered the information.

ASP tutorial
What is ASP
VBScript or JScript
ClientSide vs ServerSide scripting
ASP execution order
Dealing with Form
 
 

 

Best books about ASP & ASP.Net from Amazon
Beginning Dynamic Websites : with ASP.NET Web Matrix (Programmer to Programmer) (Paperback) Build Your Own ASP.NET Website Using C# & VB.NET (Build Your Own) (Paperback) Professional Active Server Pages 3.0 (Programmer to Programmer) (Paperback) ASP.NET Cookbook (Paperback) ASP.NET Kick Start (Paperback)

 

Printer Inkjet A Z lyricsLearn ChineseHome|PHP|Swing|HTML|JavaScript|ASP|JAVA|Forum|WebTip|Contact Us
Copyright © kidslovepc.com All rights reserved(new). Privacy|Copyright
designed by info@kidslovepc.com

Please help us cover the web site maintenance fee.
barcode scanner Thermal Printer credit card machine bar code printer