View Full Version : Search bar - link form

01-23-2007, 05:41 PM
I'm a newbie to the art of coding but I want to code a form box into a search box type thing. The closest I've found to the link box I want is this:
<form action="#">
Type in a URL, and hit the Go! button to go there!
<br />
<input name="the_url" type="text" value="http://" size="25" />
<input type="button" value="Go!" onClick="window.location=this.form.the_url.value" />

What I want my search bar/link bar is that when you type in say "joe" i want it to go to page ../joe.htm (I'm using microsoft frontpage btw). Is there anyway I can code that somehow? Any help would be great. Thank you in advance :)!

01-23-2007, 11:53 PM
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<script type="text/javascript">
function searchIt()
var yoursite = 'http://www.yoursite.com/';
var suffix = '.htm';
window.location = yoursite + document.forms[0].goto.value + suffix;
return false;
<form action="#" method="post" onsubmit="return searchIt()">
<input type="text" name="goto" value="Enter Page Name Here" onfocus="if(this.value == this.defaultValue) this.value = ''" onblur="if(this.value == '') this.value = this.defaultValue">
<input type="submit" value="Submit">