Oh man, we were getting so close & you would be a life saver. :) I can now click on the link, but unfortunately, it's not directing it to the site. Instead, it's adding it on to the domain instead of opening up the URL on it's own. Any thoughts to resolve that?
Again, thanks so much for the help with this. On Wednesday, August 7, 2013 11:34:10 PM UTC-4, asgallant wrote: > > There are a few errors you need to fix: > > 1) you are missing the "function drawVisualization ()" descriptor before > the start of the function call > 2) you created a formatter, but didn't use it to format anything. Also, > with the format specified, it won't create links that go anywhere. > 3) you have a table.draw call that shouldn't be there > > I fixed these for you and did a mockup here: > http://jsfiddle.net/asgallant/SGfEu/ > > > On Wednesday, August 7, 2013 8:41:47 PM UTC-4, BuildingtheNextGen wrote: >> >> Thanks for the response. Here's the page source: >> >> <form id="form1" method="post" action ="/index.php"> <label><input >> id="search" name="search" type="text" /></label><label><input type="submit" >> /></label></form><p><script type="text/javascript" >> src="http://www.google.com/jsapi"></script><script >> type="text/javascript">google.load('visualization', '1', {packages: >> ['table']});</script><script type="text/javascript">{var query = new >> google.visualization.Query('https://docs.google.com/spreadsheet/ccc?key=0AmOkf3tfSbwedHVmN2FPdUo2Mk9pUkNMQzlhd0F4OHc#gid=0');query.setQuery('SELECT >> A, B, C, D, E where upper(A) like upper("%%") or upper(B) like upper("%%") >> or C like "%%" or upper(D) like upper("%%") or upper(E) like >> upper("%%")order by A asc');query.send(handleQueryResponse);}function >> handleQueryResponse(response) {if (response.isError()) {alert('Error in >> query: ' + response.getMessage() + ' ' + >> response.getDetailedMessage());return;}var formatter = new >> google.visualization.PatternFormat('<a href="#">{0}</a>');var data = >> response.getDataTable();visualization = new >> google.visualization.Table(document.getElementById('table'));visualization.draw(data, >> {allowHtml: true, legend: 'bottom'});table.draw(view, {allowHtml: >> true})}google.setOnLoadCallback(drawVisualization);</script><div >> id="table"></div></div> >> >> >> >> On Wednesday, August 7, 2013 7:52:43 PM UTC-4, asgallant wrote: >>> >>> You have used the option correctly, so my guess is that the data being >>> retrieved from the spreadsheet isn't formatted correctly. Could you share >>> a link to the page or post the javascript rendered in a browser (open the >>> page in a browser, view the source, and copy the javascript) so I can test >>> it? >>> >>> On Wednesday, August 7, 2013 7:43:58 PM UTC-4, BuildingtheNextGen wrote: >>>> >>>> I'll begin by saying that I know very, very little about coding at all. >>>> I was hoping to get a google spreadsheet in a searchable format that will >>>> display only the records related to the keyword search. I found a great >>>> blog post that helped to explain this. I was able to get the searchable >>>> database. It shows all of the columns on my google spreadsheet. However, I >>>> have one column with a bunch of URLs. In the google spreadsheet itself, it >>>> displays with the active links. However, when I use the script, it only >>>> displays the text (whether I have the actual URL there or the text with >>>> the >>>> link to the URL). I saw in another post that I needed to be sure to enter >>>> allowHtml: true (case sensitive). However, it does not seem to work. >>>> >>>> Does anyone happen to know how to resolve this issue? Below is what I >>>> have for that portion of the coding (Again, I know very little of coding. >>>> I >>>> just copied the entire code & inserted the link to the google >>>> spreadsheet). >>>> Thanks in advance! >>>> >>>> <form id="form1" method="post" action ="<?php echo >>>> $_SERVER['PHP_SELF']; ?>"> <label> >>>> <input id="search" name="search" type="text" /> >>>> </label> >>>> <label> >>>> <input type="submit" /> >>>> </label> >>>> >>>> </form> >>>> <p> >>>> >>>> <?php >>>> $search= $_REQUEST['search']; >>>> if ($search > ''){ $search = $search;} else { $search = '';} >>>> ?> >>>> >>>> <script type="text/javascript" src="http://www.google.com/jsapi >>>> "></script> >>>> <script type="text/javascript"> >>>> google.load('visualization', '1', {packages: ['table']}); >>>> </script> >>>> <script type="text/javascript"> >>>> >>>> { >>>> >>>> var query = new google.visualization.Query( >>>> 'GOOGLE URL GOES HERE'); >>>> >>>> query.setQuery('SELECT A, B, C, D, E where upper(A) like upper("%<?php >>>> echo $search; ?>%") or upper(B) like upper("%<?php echo $search; ?>%") or >>>> C >>>> like "%<?php echo $search; ?>%" or upper(D) like upper("%<?php echo >>>> $search; ?>%") or upper(E) like upper("%<?php echo $search; ?>%")order by >>>> A >>>> asc'); >>>> >>>> query.send(handleQueryResponse); >>>> } >>>> >>>> function handleQueryResponse(response) { >>>> if (response.isError()) { >>>> alert('Error in query: ' + response.getMessage() + ' ' + >>>> response.getDetailedMessage()); >>>> return; >>>> } >>>> >>>> var data = response.getDataTable(); >>>> >>>> visualization = new >>>> google.visualization.Table(document.getElementById('table')); >>>> visualization.draw(data, {allowHtml: true, legend: 'bottom'}); >>>> >>>> } >>>> >>>> google.setOnLoadCallback(drawVisualization); >>>> </script> >>>> >>>> <div id="table"></div> >>>> >>>> </div> >>>> >>> -- You received this message because you are subscribed to the Google Groups "Google Visualization API" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/google-visualization-api. For more options, visit https://groups.google.com/groups/opt_out.
