how to get search results to open new tab or window

  • 1
  • Question
  • Updated 6 years ago
  • Answered
how do i get my search results to open on my site on a new page....tab or window??

thanks everyone
Photo of stormydaycrafts.com

stormydaycrafts.com

  • 110 Posts
  • 1 Reply Like
  • undecided

Posted 9 years ago

  • 1
Photo of lambofgod

lambofgod

  • 875 Posts
  • 35 Reply Likes
I can't seem to pin point the code for the search box, but I do know the code for a new page:

<!--
target="_blank"
-->
If you can post the code for the search I'm sure we can figure out where this line of code needs to go!
Photo of stormydaycrafts.com

stormydaycrafts.com

  • 110 Posts
  • 1 Reply Like
@import url(http://www.google.com/cse/api/brandin...;
Custom Search
Photo of stormydaycrafts.com

stormydaycrafts.com

  • 110 Posts
  • 1 Reply Like
thank you very very much
Photo of lambofgod

lambofgod

  • 875 Posts
  • 35 Reply Likes
Thanks for posting the code. I will try some codes out to see if I can get it to work!
Photo of lambofgod

lambofgod

  • 875 Posts
  • 35 Reply Likes
I have been trying several different configurations but nothing. I guess it is how the search works. Because after the user presses "SEARCH" then the page actually goes into Google servers. Maybe there is an option on the page that you can customize it?
Photo of stormydaycrafts.com

stormydaycrafts.com

  • 110 Posts
  • 1 Reply Like
i tried and nothing happened. you used to be able to but i cant find it anymore. thanks anyway!!
Photo of lambofgod

lambofgod

  • 875 Posts
  • 35 Reply Likes
Your very welcome.
Photo of Sanja

Sanja, Official Rep

  • 10698 Posts
  • 495 Reply Likes
Hey Stormy

Are you sure that's the full code? It looks a bit off to me for some reason. Maybe it's not. Can you try repasting it for me. This time, can you please use this site to encode your code first and then paste. http://forsite.synthasite.com/encoder...

Thanks.
Photo of stormydaycrafts.com

stormydaycrafts.com

  • 110 Posts
  • 1 Reply Like
<style type="text/css"> @import url(http://www.google.com/cse/api/brandin...; </style> <div class="cse-branding-right" style="background-color:#C7D7C8;color:#968B60"> <div class="cse-branding-form"> <form action="http://www.google.com/cse&quot; id="cse-search-box"> <div> <input type="hidden" name="cx" value="partner-pub-2527229671627052:6nitoq-6dbx" /> <input type="hidden" name="ie" value="ISO-8859-1" /> <input type="text" name="q" size="31" /> <input type="submit" name="sa" value="Search" /> </div> </form> </div> <div class="cse-branding-logo"> <img src="http://www.google.com/images/poweredb...; alt="Google" /> </div> <div class="cse-branding-text"> Custom Search </div> </div>
Photo of stormydaycrafts.com

stormydaycrafts.com

  • 110 Posts
  • 1 Reply Like
better lol
Photo of Sanja

Sanja, Official Rep

  • 10698 Posts
  • 495 Reply Likes
ahhh.. much better! =) Thanks Stormy. I'll take a look at this and get back to you.
Photo of Sanja

Sanja, Official Rep

  • 10698 Posts
  • 495 Reply Likes
Try this Stormy:

<style type="text/css"> @import url(http://www.google.com/cse/api/brandin...; </style> <div class="cse-branding-right" style="background-color:#C7D7C8;color:#968B60"> <div class="cse-branding-form"> <form action="http://www.google.com/cse&quot; id="cse-search-box" target="_blank"> <div> <input type="hidden" name="cx" value="partner-pub-2527229671627052:6nitoq-6dbx" /> <input type="hidden" name="ie" value="ISO-8859-1" /> <input type="text" name="q" size="31" /> <input type="submit" name="sa" value="Search" /> </div> </form> </div> <div class="cse-branding-logo"> <img src="http://www.google.com/images/poweredb...; alt="Google" /> </div> <div class="cse-branding-text"> Custom Search </div> </div>
Photo of stormydaycrafts.com

stormydaycrafts.com

  • 110 Posts
  • 1 Reply Like
thanks you i will let you know what happens!!!
Photo of stormydaycrafts.com

stormydaycrafts.com

  • 110 Posts
  • 1 Reply Like
works perfect thank you very very much!!!!!!!
Photo of Sanja

Sanja, Official Rep

  • 10698 Posts
  • 495 Reply Likes
You're very welcome! =)
Photo of oldxpat

oldxpat

  • 3 Posts
  • 0 Reply Likes
Hi Sanja, I have the Google search results code as below. I included it inside a code that is for my website's Google custom search box which looks quite similar to your above provided code (I included the results code just above the last </div>), so in my published website (www.madentalclinic.yolasite.com) I can find the Google Custom Search Box successfully, however when I search for any word in it then there are no results displayed. Instead it displays - "404. Sorry, we can't seem to find that page, click here to return to the homepage".

Could you pls guide as to where I must paste the results code such that whenever I search a word then the results can be displayed ??
Thanks much in advance.

<div id="cse-search-results"></div>
<script type="text/javascript">
var googleSearchIframeName = "cse-search-results";
var googleSearchFormName = "cse-search-box";
var googleSearchFrameWidth = 800;
var googleSearchDomain = "www.google.com&quot;;
var googleSearchPath = "/cse";
</script>
<script type="text/javascript" src="http://www.google.com/afsonline/show_...;
Photo of Gop

Gop

  • 7473 Posts
  • 2115 Reply Likes
Hello oldxpat,

There are a few of these Google search box codes around. I don't know the answer to your question but unless you have a specific need for this particular code then I would suggest that you try the code that Sanja posted previously.
Photo of oldxpat

oldxpat

  • 3 Posts
  • 0 Reply Likes
Hi Gop, Thank you for the prompt reply.

As per my knowledge, there are 2 codes:-
1) Code for the Search box where I can type the words that I want to search. This code is what Sanja had posted previously. I have no problem with this code because I had successfully included this code in my website by dragging the HTML widget and pasting that code in it. I believe it works fine because in my website that search box gets displayed successfully.

2) The 2nd code is what I pasted above and its used for displaying the results when I search a word in that search box. Since every search box must display a result once we type a word in it & click enter; so its important to know where to paste this code, else just having a search box displayed which does not produce any result is of no use. So Where I need to paste this code is what I wanted to know.
Appreciate if you or anyone can help. Thanks much.
Photo of Gop

Gop

  • 7473 Posts
  • 2115 Reply Likes
Thank you for responding oldxpat.

When you type in a search query into the box and enter, your results will be listed in a new tab. You don't have to create a place for the results to be displayed.

If you have a specific need that I am not understanding then please feel welcome to let me know.
Photo of oldxpat

oldxpat

  • 3 Posts
  • 0 Reply Likes
Hi Gop,

I have already tried by not creating any place for the results to be displayed, however it does not work.

My website = www.madentalclinic.yolasite.com; if you want you can give it a try as well by typing a word in the search box & click enter then you will see the error message displayed is "404. Sorry, we can't seem to find that page, click here to return to the homepage"
Photo of Gop

Gop

  • 7473 Posts
  • 2115 Reply Likes
Hello oldxpat,

Yes. I noticed that yesterday Oldxpat. I think that there is code is an issuewith that specificcode so I suggest that you use the code as mentioned rather than the one you have as I tested that yesterday also and it does work.

There may also be an issue with Google indexing your site as site searches can only work if your site has been indexed by Google.
Photo of Sanja

Sanja, Official Rep

  • 10698 Posts
  • 495 Reply Likes
Hello oldxpat,

If you still have trouble with this, I suggest double-checking that the URL is correct for this line: var googleSearchDomain = "www.google.com&quot;;.

You may need to include the http://

If this still doesn't work, then you may need to stick with the original code.