Low cost ecommerce web development India flash website design 

HANDLING USER INPUT : FORMS & QUERYSTRINGS

What good is a language that won't allow you to read user input effectively!

HTML, the good old markup language provides the user with forms to enter

his data in, and you, as an ASP programmer, can write scripts to process the

input.

The Request.Form Collection

When you have an HTML form, say,

<FORM METHOD=”post” ACTION=”process.asp”>

<INPUT TYPE=”text” NAME=”FirstName”>

<INPUT TYPE=”text” NAME=”LastName”>

<INPUT TYPE=”radio” NAME=”Sex” VALUE=”M”>

<INPUT TYPE=”radio” NAME=”Sex” VALUE=”F”>

<TEXTAREA NAME=”Address”>

</TEXTAREA>

<INPUT TYPE=”submit” VALUE=”Send”>

</FORM>

you have within it a number of elements, each with a unique name. The fields

in the form above are FirstName (Text), LastName (Text), Sex (Option: M or

F), and Address (Multiline Text). The last input type is “submit” that is a

button required to submit the user input to your script. On clicking the Submit

button, the contents of each of these fields are posted to the script that you

specified in the FORM Action attribute. In the above example, it is

process.asp”.

The form processing script can access these input values as below:

Request.Form (“FirstName”)

Request.Form (“LastName”)

Once you have this value, you can process it as you need – enter it into a

database, mail it to yourself, - anything you want.

32

Please note that the METHOD specified in the FORM tag must be POST if

you want to use the Request.Form collection to process it.

To know how to enter these into a database, skip to the next chapter. To know

about another technique of passing input to an ASP page, read on ...

 

freelance web designer India web development

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73