Modify Custom Search Box

This is cse generated Javascript Code

<div style="width:250px;">
    <script>
      (function() {
        var cx = '010787842564776071847:h_-fbbdfsvu';
        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:searchbox-only></gcse:searchbox-only>
</div>

By default search box from above code.




Modify Code :

<div style="width:250px;">                       
<form id="searchform" id="searchform" action="http://www.google.com/cse" accept-charset="utf-8">
    <input value="010787842564776071847:h_-fbbdfsvu" name="cx" type="hidden"/>
    <!---<input value="FORID:9" name="cof" type="hidden"/>--->
    <input  id="q" name="q" size="20" type="text" placeholder="search website..." /> 
    <input type="image" src="images/glass.png" height="28px" align="absmiddle">
</form>
</div>

After modify search box from above code.





For Displaying Ads

If you select Right, use this FORID:9
<input type="hidden" name="cof" value="FORID:9" /> in your code.

If you select Top and Right, use this FORID:10
<input type="hidden" name="cof" value="FORID:10" />

And if you select Top and Bottom, use this FORID:11
<input type="hidden" name="cof" value="FORID:11" />

Comments

Popular posts from this blog

Login with facebook using coldfusion

Create CSV file in Coldfusion Using CFFile

Get Previous One Day Data in Sql Server