Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Focus the cursor in Search field


Andybird

Recommended Posts

JanZ,

 

I've already found that info on the web. The code is very simple, something like:

 

<form ... name="myform">

<input name="myfield" ...>

...

</form>

<script type="text/javascript">

document.myform.myfield.focus();

</script>

 

Actualy, the problem is that I just don't know what is the name for "myform" and "myfield" as regarding to the quick search field of OsCommerce.

 

Thanks,

Andybird

Link to comment
Share on other sites

I've already found that info on the web. The code is very simple
Then you are not formulating your questions clearly enough :)
Actualy, the problem is that I just don't know what is the name for "myform" and "myfield" as regarding to the quick search field of OsCommerce.
A "view source" on the index page should tell enough:

	<td align="center" class="boxText"><form name="quick_find" action="http://yoursite/advanced_search_result.php" method="get"><input type="text" name="keywords" size="10" maxlength="30" style="width: 95px"> <input type="image" src="includes/languages/english/images/buttons/button_quick_find.gif" border="0" alt="Quick Find" title=" Quick Find "><br>Use keywords to find the product you are looking for.<br><a href="http://yoursite/advanced_search.php"><b>Advanced Search</b></a></form></td>

Link to comment
Share on other sites

Thanks! Now adding the following lines to search.php, afte the last ?>, put the currsor in the search field:

 

<script type="text/javascript">

document.quick_find.keywords.focus();

</script>

 

Best,

Andybird

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...