Parameters in Hyperlinks

S

Steve A

I want to hyperlink to an asp page, using a variable from
a form (drop down box) as the parameter, but I cant work
out how to reference the form field.

I am creating a hyperlink to an asp page which looks up a
database. The basic stuff all works fine, and the
database lookup is by state. If I code the hyperlink to
the page as http://searchpage.asp?State=WA - it works
fine, and returns all the records for WA.

The Form 'name' is xyz, and the form field (drop down
box) is called statebox, is there any way of using the
form field as the parameter instead of hard coding as in
the example above?

Many thanks,
Steve
 
G

grw

Im assuming you are using the FP DRW?
If so, youll be passing the parameter 'state' to your current query.
Something along the lines of :

"select * from table where state='::state::' "

To use a form field, you would use exactly the same SQL as you do now,
except change to :

"select * from table where state='::statebox::' "

(Otherwise, if you rename the list box name to "state" you wont need to
change a thing)
 
S

Steve A

No, the file is a simple excel spreadsheet, so the lookup
does not use SQL. But that is not the problem.. I did not
explain the problem well enough.

To get to the 'database' lookup page (asp) I link to that
page from a normal html page. The asp loads with 'null'
results, because I just link to the page with a normal
hyperlink. I found out by trial and error that if I
initially link to the page with a parameter (EG
http://searchpage.asp?State=WA ) it links to the search
page, and returns all the records with state - WA.

So what I want to know is TWO things really..
1. When creating a hyperlink, can the 'parameter' be a
variable?
2. If so, what is the syntax for accessing the value of
an entry in a drop down list box?

Does that make any sense ?

Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top