Jaskaran Posted February 13, 2010 Share Posted February 13, 2010 Hello!! i put a search box in header with following code. <?php echo tep_draw_form('search', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get') . tep_draw_hidden_field('search_in_description','1') . tep_draw_input_field('keywords', '','id="txtSearch" size="10" maxlength="30" style="width: ' . (BOX_WIDTH+10) . 'px"') . ' ' . tep_draw_pull_down_menu('categories_id', tep_get_categories(array(array('id' => '', 'text' => BOX_ALL_CATEGORIES)))) . ' ' . tep_hide_session_id() . '<input type="submit" name="Submit" value="Search">' . '</form>'; ?></td> Deafult value of text box in header is "enter search keyword" which is coming form "advanced_search_result.php". now i want put a javascript function to clear the text box value on Click. How and where set the onclick function? Regards Jaskaran Link to comment Share on other sites More sharing options...
Jaskaran Posted February 13, 2010 Author Share Posted February 13, 2010 I found the answer myself!! No need for reply! Thanks!! Link to comment Share on other sites More sharing options...
multimixer Posted February 13, 2010 Share Posted February 13, 2010 Can you say what the answer is? maybe somebody else will be interested in this too My community profile | Template system for osCommerce - New: Responsive | Feedback channel Link to comment Share on other sites More sharing options...
Jaskaran Posted February 18, 2010 Author Share Posted February 18, 2010 Yes sure George Zarkadas!! function hide1() { document.advanced_search.keywords.value=''; } 1. Put this function in the header of advanced_search.php 2. Near line 170, call this funtion like this.. $info_box_contents[] = array('text' => tep_draw_input_field('keywords','','onclick="hide1();"','style="width: 100%"' )); 3.In file advanced_search_result.php near line 124.. find if ($error == true) { tep_redirect(tep_href_link(FILENAME_ADVANCED_SEARCH, 'keywords', 'NONSSL', true, false)); } and put the value of keywords. keywords=Enter Search String' All done! Regards Jaskaran Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.