E
emu
Hi
I have a form which is contained in a <div> in the template which
searches our Intranet, Staff directory or Google. This form needs to
work client side so I am using JavaScript and HTML no server code. It
need to submit to itself for now
I want the form to show the last value selected when they submit the
form. It would be good to bring through the name that they were
searching for as well.
Any idea greatly appreciated.
I have edited this code down to basics
<div id="search">
<script type="text/javascript" language="JavaScript">
function ActionDeterminator()
{
f = document.selectSearchForm.searchme.selectedIndex;
x = document.selectSearchForm.searchme[f].value;
document.selectSearchForm.action=x
if (f=1){
document.selectSearchForm.name.value=document.selectSearchForm.queries_search_query.value
}
if (f=2){
document.selectSearchForm.q.value=document.selectSearchForm.queries_search_query.value
}
return true;
}
</script>
<form name="selectSearchForm" action="" method="get" onSubmit="return
ActionDeterminator();" />
<input type=hidden name=mode value=results />
<input type=hidden name=name />
<input type=hidden name=q />
<strong>search</strong>
<select name="searchme" onChange="return ActionDeterminator();">
<option value="http://localhost/search2.html"
name="Intranet">Intranet</option>
<option value="http://localhost/search2.html"
name="Staff directory">Staff directory</option>
<option value="http://www.google.com/search"
name="Google">WWW (Google)</option>
</select>
<input name="queries_search_query" type="text" value="" />
<input type=hidden name=submit VALUE="Search" />
<input type="image" alt="search" src="go.gif"
value="Search" style="display:inline"/>
</form>
</div>
I have a form which is contained in a <div> in the template which
searches our Intranet, Staff directory or Google. This form needs to
work client side so I am using JavaScript and HTML no server code. It
need to submit to itself for now
I want the form to show the last value selected when they submit the
form. It would be good to bring through the name that they were
searching for as well.
Any idea greatly appreciated.
I have edited this code down to basics
<div id="search">
<script type="text/javascript" language="JavaScript">
function ActionDeterminator()
{
f = document.selectSearchForm.searchme.selectedIndex;
x = document.selectSearchForm.searchme[f].value;
document.selectSearchForm.action=x
if (f=1){
document.selectSearchForm.name.value=document.selectSearchForm.queries_search_query.value
}
if (f=2){
document.selectSearchForm.q.value=document.selectSearchForm.queries_search_query.value
}
return true;
}
</script>
<form name="selectSearchForm" action="" method="get" onSubmit="return
ActionDeterminator();" />
<input type=hidden name=mode value=results />
<input type=hidden name=name />
<input type=hidden name=q />
<strong>search</strong>
<select name="searchme" onChange="return ActionDeterminator();">
<option value="http://localhost/search2.html"
name="Intranet">Intranet</option>
<option value="http://localhost/search2.html"
name="Staff directory">Staff directory</option>
<option value="http://www.google.com/search"
name="Google">WWW (Google)</option>
</select>
<input name="queries_search_query" type="text" value="" />
<input type=hidden name=submit VALUE="Search" />
<input type="image" alt="search" src="go.gif"
value="Search" style="display:inline"/>
</form>
</div>