views:

37

answers:

1

I have a issue, I have a form called quicksearch

CODE

<form method="GET" name="quicksearch" action="search_results.php">

   <input name="search" type="text" id="search" size="50" value="<?=@$_REQUEST['search']?>">

  </form>

The submit button is an image map

and looks as follows

<img src="images/header_16.jpg" alt="" width="111" height="42" border="0" usemap="#Map3">

How can I submit this using javascript, I have the following but it fails everytime and does nothing.

<map name="Map3">

  <area shape="rect" coords="2,4,109,39" href="javascript:document.quicksearch.submit();">

</map>
+2  A: 

Try using:

document.forms[0].submit();

This should submit the first form on the page.

Or even give the form an id and use this:

document.getElementById('formID').submit();
matpol