Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    May 2006
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Form with multiple objects

    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

  • #2
    New Coder
    Join Date
    Aug 2002
    Location
    UK
    Posts
    35
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #3
    Senior Coder
    Join Date
    Nov 2002
    Location
    North-East, UK
    Posts
    1,265
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.


  •  

    Posting Permissions

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