The documentation of DuckDuckGo isn’t very clear about adding a site search form to your site. They give an example using an iframe, but that’s not so great, because you don’t have much control over the style, especially that green button, for example here:

<iframe src=" DuckDuckGo" style="overflow:hidden;margin:0;padding:0;width:408px;height:40px;" frameborder="0"></iframe>

Luckily they included a link to the blog of the founder, which demonstrates how to do this, essentially:

<form action="">
  <input type="text" name="q">
  <input type="hidden" name="sites" value="">
  <button type="submit">Search</button>

The same thing, but using Bootstrap 3 style:

<form class="form-inline" role="search" action="">
  <div class="form-group">
    <input type="text" name="q" class="form-control" placeholder="Search on">
    <input type="hidden" name="sites" value="">
  <button type="submit" class="btn btn-default">Search</button>

Yes, finally I added site search to this site (see the navbar!), it was really long overdue!

blog comments powered by Disqus