...

View Full Version : Form with multiple objects



luma
05-01-2006, 11:47 PM
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

Luma

ihitman
05-02-2006, 10: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.

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

http://degs.co.uk/test/javascript/search_engines.htm
This is javascript, but the method is similar for ASP VBScript.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum