...

View Full Version : HREF onclick in search form



mxcoop98
11-04-2010, 08:34 PM
I'm trying to figure out how to add a typed search variable to the end of a url string with the follow code:

[CODE]
<form action="" id="search-form">
<div class="rowElem"><strong>
<input type="text" value="Enter Artist, Team, or Venue"></strong>
<a href="#" onclick="document.getElementById('search-form').submit()"> <span><span>search</span></span></a></div>
</form>
[CODE]

The URL would be something like Results.html?kwds='whatever searched'

I've tried everything

DrDOS
11-04-2010, 11:17 PM
Your form is not complete enough to do what you want. Here is a more complete one that works. It doesn't involve any javascript but you can add javascript, php or whatever to act on the changed URL.
<form action="" method="get" id="search_form" name="search_form">

<input type="text" value="Enter_Artist" name="myform">

<input type="submit" value="Search">

</form>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum