Skip to main content
higgsyd
Inspiring
September 19, 2018
Answered

why is my search bar not working?

  • September 19, 2018
  • 2 replies
  • 1435 views

If you go here:

http://ancestry.higgsy.co.uk/

the search works

If you go to my dev version here:

http://v38.ancestry.higgsy.co.uk/

it doesn't work.  I think the first one works by passing the search term to a google search.  The second one I got by inserting it from the DW Bootstrap Insert panel (I hope the nice Mr Osgood will not harass me for that!) What else do I need to add to the second one to make it work?  I have searched for the answer but all the tutorials I look at seem to concentrate on using CSS to format it, not tell me how it actually works - many thanks

This topic has been closed for replies.
Correct answer Nancy OShea

I wrote a tutorial on this a while back.  But Google wants everyone to use a custom search API now.

Add Google to your Bootstrap Search Bar

 

Edited Nov 2020:  Use this - https://developers.google.com/custom-search/v1/overview

 

2 replies

Nancy OShea
Community Expert
Nancy OSheaCommunity ExpertCorrect answer
Community Expert
September 19, 2018

I wrote a tutorial on this a while back.  But Google wants everyone to use a custom search API now.

Add Google to your Bootstrap Search Bar

 

Edited Nov 2020:  Use this - https://developers.google.com/custom-search/v1/overview

 

Nancy O'Shea— Product User & Community Expert
higgsyd
higgsydAuthor
Inspiring
September 22, 2018

Thanks everyone, it is now working

Jon Fritz
Community Expert
Community Expert
September 19, 2018

The Bootstrap search field you get from the templates available in DW don't actually "do" anything. They're just dummy html forms. They're not attached to anything until you add an action attribute and link to a form processing script.

Your working form...

<form action="http://www.google.com/search" method="get" onSubmit="Gsitesearch(this)">

<input name="q" type="hidden"/>

<input name="qfront" type="text" style="width: 180px"/>

<input type="submit" value="Search"/>

<br/>

</form>

The Bootstrap placeholder form...

<form class="form-inline my-2 my-lg-0">

<input class="form-control mr-sm-2" type="search" placeholder="Search" aria-label="Search">

<button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>

</form>


If you use the same action, inputs and names, the new form should work like the old one did.