Change Link With Html Dropdown
I'm trying to use the values from an HTML dropdown menu to change the 'where' of the Google Spreadsheet query HTML table. Here's the dropdown as I have it so far:
Solution 1:
$('option').click(function(e){
var$item = $(e.currentTarget).attr('value');
updateIframe($('iframe'), $item);
});
functionloadIframe(iframeName, url) {
if ( $iframe.length ) {
$iframe.attr('src',url);
returnfalse;
}
returntrue;
}
Solution 2:
You can do this using javascript. First you need to add id to the select
So change your list to
<select id="myID"> <====== heres the change
<option value="volvo">Volvo</option>
<optionvalue="saab">Saab</option><optionvalue="mercedes">Mercedes</option><optionvalue="audi">Audi</option>
</select>
var value = document.getElementById("myID");
var selectedString = value.options[value.selectedIndex].value;
here selectedString
contains the value to be added to the string in IFrame.
var Url="https://docs.google.com/spreadsheets/d/*spreadsheet key*/gviz/tq?tqx=out:html&tq=select+A,B,D,E,F,G+**where+D+contains+selectedString+&gid=2105149734"
or use innerHTML
Post a Comment for "Change Link With Html Dropdown"