70 likes | 212 Views
User Input. This lesson will discuss how to collect information from the user and sending information back to an ASP page for processing. Four general methods of acquiring information from a user are: Text Box, List Box, Check Box and Radio Button. Text Box:. <INPUT Text> Command
E N D
User Input This lesson will discuss how to collect information from the user and sending information back to an ASP page for processing. Four general methods of acquiring information from a user are: Text Box, List Box, Check Box and Radio Button.
Text Box: • <INPUT Text> Command • Example: <input type=“text” name=“something” size=5 maxlength=10> • <INPUT Password> command <input type=“password” name=“password”size=5 maxlength=5>
Radio Button: • <Input Radio> Command • <input type=“radio” name=“anything” value=“single” checked>Single • <input type=“radio” name=“anything” value=“married”>Married • In first radio button will be checked automatically.
Check Box: • <Input Checkbox> Command • <input type=“checkbox” name=“anything” value=“1”>ID# • <Input type=“checkbox” name=“anything” value=“2”>SIN#
List Box: • The <Select> Command, it will create drop down list box. • <select name=“option”> <option>Senior Analyst <option selected>Programmer <option>Operator <option>System Manager </selected>
Creating Forms: • First you create Form in order to use Text Box, Radio Button, List Box and Check Box. • So, a Form has two duties: to collect information from the user and to send that information to a separate web page for processing. • <form name=“test” action=“test.asp” method=“post”> • Here, Method=post indicates that we have to use Request.Form in test.asp to access user input data from the Form. You can use method=Get also, but it is not safe as it allows anyone to see valuable information in the URL. When you use Form you should always use Method=Post
Use of Session Objects (discussed in week-4) • How to create Session • How to assign time length • How to end session immediately • Store and retrieve Session variables. • Example Program of using session variable.