Passing Parameters from one page to another

Results 1 to 3 of 3

Thread: Passing Parameters from one page to another

  1. #1
    Join Date
    Dec 1969

    Default Passing Parameters from one page to another

    Hello - <BR><BR>I&#039;ve got a form that contains a drop-down box called "Category" whose contents are created from a database. When user submits a form, (s)he is to be taken to a new page that displays details for a specific category, dependent on what the user selected in the drop-down box.<BR><BR>My question - how do I define the Category drop-down box parameter so that I can pass it to the new page - and in turn, have the parameter specified as a variable on which my SQL query can use as filtering criteria?<BR><BR>Any assistance is greatly appreciated!

  2. #2
    Join Date
    Dec 1969

    Default RE: Passing Parameters from one page to another

    &#060;select name=list1&#062;<BR>&#060;option value=1&#062;USA&#060;/option&#062;<BR>...<BR>&#060;/select&#062;<BR><BR>when the form is submitted, on the target asp page, you need to<BR>capture the value of select box in a variable as<BR><BR>listboxvalue = request.form("list1")<BR><BR>then in the SQL, you substitute it as<BR><BR>mysql = "select * from table1 where column1=" & listboxvalue<BR>conn.execute(mysql)<BR><BR>that&#0 39;s all.<BR><BR>if listboxvalue is a string then you must enclose it in single quotes in the sql statement.<BR>

  3. #3
    Join Date
    Dec 1969

    Default RE: Method = POST

    The form method should be POST in order to be able to retrieve it&#039;s value on the target page.<BR><BR>&#060;form name=form1 method=POST action="target.asp"&#062;<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