View Full Version : Search when pressing enter

11-06-2010, 09:13 PM
When I press enter on the webpage it wont search, only when the button is clicked.

<?php if ($keyword) { ?>
<input type="text" value="<?php echo $keyword; ?>" id="filter_keyword" />
<?php } else { ?>
<input type="text" value="<?php echo $text_keyword; ?>" id="filter_keyword" onclick="this.value = '';" onkeydown="this.style.color = '000000'" style="color: #999;" />
<?php } ?>
<a onclick="moduleSearch();"><img src="catalog/view/theme/ProShop/image/search_button.png" alt="search" align="top" /></a></div>

Not sure what to do, hope you can help.

Thanks, Bevans.

11-06-2010, 09:41 PM
I don't see the post method anywhere.

<form action="page.php" method="post">
//Text boxes, submit button, etc

That way you can type in the box and press enter.

11-06-2010, 09:44 PM
This is their problem:

<a onclick="moduleSearch();">

Not surprising it doesn't catch a key press. This should be in the JS section, btw.