Andybird Posted January 4, 2007 Share Posted January 4, 2007 Hi, Anyone can say how to focus the cursor in the Search field of the Quick Search box when opening the site? Thanks, Andybird Link to comment Share on other sites More sharing options...
Andybird Posted January 6, 2007 Author Share Posted January 6, 2007 Any idea??? Thanks, Andybird Link to comment Share on other sites More sharing options...
Jan Zonjee Posted January 6, 2007 Share Posted January 6, 2007 Anyone can say how to focus the cursor in the Search field of the Quick Search box when opening the site? A little search goes a long way. Link to comment Share on other sites More sharing options...
Andybird Posted January 6, 2007 Author Share Posted January 6, 2007 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 More sharing options...
Jan Zonjee Posted January 6, 2007 Share Posted January 6, 2007 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 More sharing options...
Andybird Posted January 7, 2007 Author Share Posted January 7, 2007 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.