Nevermind, I got it by using onclick and calling the myHandler on the search term.
On Aug 17, 11:05 pm, alpapa <[email protected]> wrote: > One last question... I promise :) > > Is there any way to add a hyperlink to automatically search for > suggested search terms? For example, a hyperlink that says 'shopping' > and automatically have a search for shopping submitted through the > form? > > If I can get that, my life will be complete. > > On Aug 17, 5:01 pm, Vision Jinx <[email protected]> wrote: > > > > > Glad it helped :) > > > On Aug 17, 2:26 pm, alpapa <[email protected]> wrote: > > > > That worked, thanks! You're the man! > > > > On Aug 17, 2:57 pm, Vision Jinx <[email protected]> wrote: > > > > > Hi, > > > > > A few things need to be addressed there. You can't (I'm pretty sure, > > > > but I am not a lawyer) have the Google branding on the form if your > > > > using it to execute a search for another app/api. So, I added a custom > > > > form instead and moved the Google branding to the results that are > > > > being generated by Google. Again, you may want to check the TOS to > > > > make sure this (meaning your use) is compliant with their terms > > > > (regarding mixing results) > > > > >http://paste-it.net/public/m600992/ > > > > > In the function myHandler replace the alert with your other call. > > > > > Also, you will probably want to strip out any code from being added to > > > > your code (via the search form) to prevent any code injection into > > > > your app also ;) (the "q" in the myHandler function) > > > > > Cheers! > > > > Vision Jinx > > > > > On Aug 17, 11:51 am, alpapa <[email protected]> wrote: > > > > > > Thanks for the help... here's what I got- > > > > > >http://paste-it.net/public/b4042ab/ > > > > > > On Aug 17, 1:32 pm, Vision Jinx <[email protected]> wrote: > > > > > > > Hi, > > > > > > > On your search form you pass the text box value to your javascript > > > > > > function. > > > > > > > either > > > > > > > onsubmit="myFunction(this);return false;" > > > > > > > or > > > > > > > onsubmit="myFunction(this.textBox.value);return false;" > > > > > > > function myFunction(q){ > > > > > > // Google API Search Control > > > > > > searchControl.execute(q); > > > > > > // Your Other Searcher Function > > > > > > otherSearcher.whatever(q); > > > > > > > } > > > > > > > Since I can't see any of your code I can't be more specific ;) > > > > > > > If you can provide a link to your app or paste your code in paste-it > > > > > > (http://paste-it.net/) or something I may be able to be a bit more > > > > > > specific. :) > > > > > > > On Aug 17, 11:20 am, alpapa <[email protected]> wrote: > > > > > > > > Not sure I follow, could you be more specific? I'm fairly new to > > > > > > > using these apis. I think I understand the onsubmit, but how do I > > > > > > > actually get the search value from the ajax search? > > > > > > > > On Aug 17, 1:10 pm, Vision Jinx <[email protected]> wrote: > > > > > > > > > Hi, > > > > > > > > > Tread with caution and read the Google TOS regarding not being > > > > > > > > able to > > > > > > > > mix results (and Google branding etc), but assuming your > > > > > > > > following the > > > > > > > > TOS... > > > > > > > > > You just make a wrapper function for it. Attach the event to > > > > > > > > your > > > > > > > > search forms onsubmit handler and you can call what ever > > > > > > > > functions you > > > > > > > > need that way. > > > > > > > > > Cheers! > > > > > > > > Vision Jinx > > > > > > > > > On Aug 17, 10:53 am, alpapa <[email protected]> wrote: > > > > > > > > > > Thanks, I actually may keep the search on one page after some > > > > > > > > > thought. Any idea how to take the search term and pass it > > > > > > > > > into the > > > > > > > > > other javascript element? Basically what I want to do is the > > > > > > > > > same as > > > > > > > > > twootles.com. I have both pieces working on different pages, > > > > > > > > > but it > > > > > > > > > makes more sense that when you do a search results for both > > > > > > > > > appear. > > > > > > > > > > On Aug 17, 12:38 pm, Vision Jinx <[email protected]> wrote: > > > > > > > > > > > Hi, > > > > > > > > > > > Even though having the results on a different page kinda > > > > > > > > > > defeats the > > > > > > > > > > whole "ajaxy" feel of the app it is easily done by using a > > > > > > > > > > get method > > > > > > > > > > on your search form then on the results page you can grab > > > > > > > > > > the url > > > > > > > > > > values (window.location.search for example) and execute the > > > > > > > > > > searches > > > > > > > > > > that way. You can have a look at my source code here > > > > > > > > > > >>http://www.visionjinx.net/ > > > > > > > > > > for how I am doing it with my app. (look for vj.getApi) > > > > > > > > > > > Alternatively, If your using PHP (or example) then you can > > > > > > > > > > also grab > > > > > > > > > > the values that way ($_GET/$_POST) and use it when > > > > > > > > > > generating the > > > > > > > > > > page. > > > > > > > > > > > Cheers! > > > > > > > > > > Vision Jinx > > > > > > > > > > > On Aug 17, 9:11 am, alpapa <[email protected]> wrote: > > > > > > > > > > > > Better yet, is there any way to get the value that is > > > > > > > > > > > being searched > > > > > > > > > > > to use it in another javascript element? What i would > > > > > > > > > > > like to do is a > > > > > > > > > > > twitter search at the same time using juitter, by passing > > > > > > > > > > > the search > > > > > > > > > > > value into the juitter code as well. > > > > > > > > > > > > On Aug 17, 9:44 am, alpapa <[email protected]> wrote: > > > > > > > > > > > > > I have a php based website, I really just need the > > > > > > > > > > > > searchbox on every > > > > > > > > > > > > page and the results to appear on a standard results > > > > > > > > > > > > page, nothing > > > > > > > > > > > > fancy. > > > > > > > > > > > > > On Aug 16, 9:24 pm, Jeremy Geerdes > > > > > > > > > > > > <[email protected]> wrote: > > > > > > > > > > > > > > There are a number of ways to do this. The easiest > > > > > > > > > > > > > and best solution > > > > > > > > > > > > > will depend very much on your application needs. > > > > > > > > > > > > > > Jeremy R. Geerdes > > > > > > > > > > > > > Effective website design & development > > > > > > > > > > > > > Des Moines, IA > > > > > > > > > > > > > > For more information or a project > > > > > > > > > > > > > quote:http://jgeerdes.home.mchsi.comhttp://jgeerdes.blogspot.comhttp://jgee... > > > > > > > > > > > > > [email protected] > > > > > > > > > > > > > > Unless otherwise noted, any price quotes contained > > > > > > > > > > > > > within this > > > > > > > > > > > > > communication are given in US dollars. > > > > > > > > > > > > > > If you're in the Des Moines, IA, area, check out > > > > > > > > > > > > > Debra Heights > > > > > > > > > > > > > Wesleyan Church! > > > > > > > > > > > > > > And check out my blog, Adventures in Web Development, > > > > > > > > > > > > > athttp://jgeerdes.blogspot.com > > > > > > > > > > > > > ! > > > > > > > > > > > > > > On Aug 16, 2009, at 9:23 AM, alpapa wrote: > > > > > > > > > > > > > > > Is there any way to have the search results on a > > > > > > > > > > > > > > different page than > > > > > > > > > > > > > > the search box or any instructions on how to do > > > > > > > > > > > > > > this? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google AJAX APIs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/google-ajax-search-api?hl=en -~----------~----~----~----~------~----~------~--~---
