0

i want to put custom search in my website...google custom search...bt if i use the code it will not show my html search box...it shows google custom search box...how to use it for my search box???

3
Contributors
3
Replies
31
Views
3 Years
Discussion Span
Last Post by nauticalmac
0

this is custom search code..

<script>
  (function() {
    var cx = '013580470917512101672:0ssj6ajuova';
    var gcse = document.createElement('script');
    gcse.type = 'text/javascript';
    gcse.async = true;
    gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
        '//www.google.com/cse/cse.js?cx=' + cx;
    var s = document.getElementsByTagName('script')[0];
    s.parentNode.insertBefore(gcse, s);
  })();
</script>
<gcse:search></gcse:search>

nd my search box code is:

<form id="form1" name="form1" method="post" action="">
    <div class="lfloat"><label for="textfield"></label>
    <input name="textfield" type="text" class="searchfield" id="textfield" onclick="this.value='';" value="Search your Keyword" /></div><div style="position:relative; float:left; left:2px; margin:4px;">
    <input type="image" src="images/search_button.png" name="button" id="button" value="Submit" style="margin:0px;" /></div>
  </form>
0

What I have done is create my own search entry box which (when submitted) sends the entered search term to a separate dedicated search results page which contains the google code (and included styling) e.g. "searchresults.php?q=enteredsearchtext". This initiates a custom search when the page loads.
Example: http://www.gwscsw.org/

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.