Form variables and values

Results 1 to 5 of 5

Thread: Form variables and values

  1. #1
    Join Date
    Dec 1969

    Default Form variables and values

    What is the best way to pass form variable and values to the next page?<BR><BR>I need to create a website that takes user&#039s input from a form and put them into another ASP page for further use.<BR><BR>Thanks.

  2. #2
    Mike Stokes Guest

    Default RE: Form variables and values

    Form field values are passed as name/value pairs to whatever page you&#039ve submitted to in your Form tag, in this case "somepage.asp" in the following example:<BR><BR>&#060;form action="somepage.asp" id=form1 name=form1 method=post&#062;<BR><BR>You can retrieve these values using the Request.Form object on the destination page. Say you have two text fields on the form page named txtField1 and txtField2. You retrieve the user&#039s input as follows:<BR>&#060;%<BR>dim strField1, strField2<BR>strField1 = Request.Form("txtField1")<BR>strField2 = Request.Form("txtField2")<BR>%&#062;<BR>You can now display those input values, send them to a database or whatever. I hope this was of some help.

  3. #3
    Join Date
    Dec 1969

    Default RE: Form variables and values

    :&#060;form action="somepage.asp" id=form1 name=form1 method=post&#062;<BR><BR>what&#039s the purpose of the &#039id&#039 and &#039name&#039 in the form tag? it never seems to come up because when you collect the results of the form you just refer to the name of the particular input field. i just wondered.

  4. #4
    Sathiya Guest

    Default RE: Form variables and values

    hi their r four ways to pass variables<BR>1.Session Variables<BR>2.Using Post method in form<BR>3.Using Get method in form<BR>4.Query String<BR> Each has its own advantages and disadvantages.If ur not using the varaibels for the full session and want to pass varables only to the next page QueryString is usesful.If u want to pass varables with in the Same page Post or Get mehod is useful.

  5. #5
    SPC Systems Guest

    Default RE: Form variables and values

    Sometime users have a problem with submition .<BR><BR>It is a good idea to have JavaScript validation.<BR><BR>You can use id=form1 name=form1 to validate and submit particular<BR>form.<BR><BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts