• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 89
  • Last Modified:

Pass input text from web page to google costume search function


i need some help with some google API costume searching and html. i am trying to achieve the following Pass input text from web page to google costume search function.

Web page input text
                 <input type="text" name="Search" placeholder="Enter your keywords"/>

Open in new window

google search code

  (function() {
    var cx = '002768865969631046146:50gvw_uzv0q';
    var gcse = document.createElement('script');
    gcse.type = 'text/javascript';
    gcse.async = true;
    gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
        '//cse.google.com/cse.js?cx=' + cx;
    var s = document.getElementsByTagName('script')[0];
    s.parentNode.insertBefore(gcse, s);

Open in new window

Chris Jones
Chris Jones
  • 3
1 Solution
Eddie ShipmanAll-around developerCommented:
Which variable gets the search value?
Eddie ShipmanAll-around developerCommented:
Hey, I'm located over in Austin. My nephew goes to A&M. Here's a fiddle demonstrating how to do it:

Chris JonesLead Application Web DeveloperAuthor Commented:
cool beans this works great
Eddie ShipmanAll-around developerCommented:
So, do you think you could accept my answer?
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now