• 0

Need help with forms.


Question

I'm fluent in HTMl although not with this part.

I'm making a custom home page and at the top of the home page is a search box. What I would like to do is have it so there is a text box, drop down box and a search button. (I have all three already.) When you select an item in the drop down box that is where it will search. I have no idea how to implement this. I know how to get it to search one site but not how to get it to search the selected site. :(

Link to comment
https://www.neowin.net/forum/topic/159891-need-help-with-forms/
Share on other sites

4 answers to this question

Recommended Posts

  • 0

Well the page that it posts it's data too will need to decide what site it searches.

Either via a procedure\function or by If...Then or Select...Case argument.

e.g

if request.form("NameOfTheSelectBox"google.com" then

'do stuff to search google

elseif request.form("NameOfTheSelectBox"dogpile.com" then

'do stuff to search dogpile.com

end if

Or something?

good luck

b :)

  • 0

I'm trying to get this done in HTML.

Sites I want to search on the fly are: Amazon.com, Google.com, Google.com Imges, Download.com. I might add more if needed. It would be great to learn how now and apply those to future forms. I don't know what terms to search for to find a tutorial or know any sites that have the same. (Drop down for multiple sites) or I would try it myself.

  • 0

Maybe you can use javascript to change the action of the form or the method if neccessary to reflect that of the chosen search engine. Like google

<html>
<head>
<script type="text/javascript">
function searchengine(){
 ?if (document.form.engine.value == "google"){
 ? ?document.form.method = "get"
 ? ?document.form.action = "http://www.google.com/q"
 ?}
}
</script>
</head>
<body>
<form name="form" method="get" action="http://watever.com">rch for: <input type="text" name="query">
<br>Search Engine: <select name="engine" onchange="searchengine()">
<option value="xyz">XYZ</option>
<option value="google">Google</option>
</select>
</form>
</body>
</html>

or something similar.. Try it.. Haven't tested the above code myself eith:p... :p but it should work.

  • 0

Thanks for telling me to use Javascript. I found this and used it:

http://javascript.internet.com/forms/multi...rch-engine.html

It came with a few more so right now I can search; Google.com; Archive.com; Dictionary.com; Download.com; eBay.com; HowStuffWorks.com; Google Images; Thesaurus.

Now I need to find out how to search Amazon and i'm set. :)

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.