Search code examples
google-searchgoogle-search-api

Google Custom WebSearch: hidden controls


I have this code on my website:

<div id="cse" style="width: 100%;">Loading</div>
            <script src="//www.google.com/jsapi" type="text/javascript"></script>
            <script type="text/javascript"> 
              google.load('search', '1', {language : 'it'});
              google.setOnLoadCallback(function() {
                var customSearchControl = new google.search.CustomSearchControl('mybigbigbignumber');
                customSearchControl.setResultSetSize(google.search.Search.LARGE_RESULTSET);
                customSearchControl.draw('cse');
              }, true);
            </script>
            <link rel="stylesheet" href="//www.google.com/cse/style/look/default.css" type="text/css" />

It works as expected: the Google search bar appears, and the search results appears in the lower box.

What I need is a "transparent" search action.

I mean passing the search terms throughout my form, to the google WebSearch service, and display result in a custom css-ized list made by me.


Solution

  • I ended up using some jQuery to hide the Google standard form and trigger its submission.