Posting a form

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>&nbsp;
<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>
&nbsp;
<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>
 
M

M E

Just what I was looking for.

I will need to get it to work as part of the template but it sends me on
the right track.

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top