View Full Version : Form with multiple objects

05-02-2006, 12:47 AM
Hello everyone,

I am new to asp (very new!)
basicly I have a form that has a drop down with multiple options,
the form is used to search certain interal websites
for example lets jus pretend option one is google, option 2 is yahoo etc.
with seperate forms I can search whichever site I want but instead of having 5 forms I want 1 with a drop down with 5 options.

I have seen this done in php and I am sure it can be done in asp.
I found a few websites that talked about having multiple submit buttons which would work but it don't mention how to actualy have different actions for each submit button.

Could someone point me in the direction of information on doing this with ASP?

I apreciate it

Thank you


05-02-2006, 11:29 AM
When you process the form, you could create a bit of code that opens the search page to whatever site was selected and passes through the criteria, eg.

If Request.Form("searchBox")="google" Then
Response.Redirect("http://www.google.co.uk/search?hl=en&q=" & Request.Form("searchString") & "&btnG=Google+Search&meta=")
End If

...or wrap it up in a select statement.

05-02-2006, 03:43 PM
You could also use a Switch statement.

This is javascript, but the method is similar for ASP VBScript.