I have a simple HTML select option box and a javascript function. I currently use the function with links and buttons using an onClick event trigger.
I want to use the Select Options to trigger the function. The function (e.g, platform() triggers a filter on an embedded dashboard. I want the new function to take the value selected and apply the associated function (e..g, platform()) filter the embedded dashboard. I don't want to show what has been selected.
This is just an extract from my HTML and jS files - that include all the appropriate links to resources, such as jQuery.
How would I do this?
Note: There are currently like functions for each of the values included in the Select Options. I have only included one for the purpose of asking the question. The other functions differ only in name and the value that corresponds to the Option Select Value provided
<!DOCTYPE html>
<html>
<body>
<form>
<h3>Color Detail</h3>
<br>
<p>Select the level of detail to depict by color.</p>
<select id="select_a" name="color">
<option value="Organization">Organization</option>
<option value="Parent Organization">Parent Organization</option>
<option value="Parent Organization">Parent Organization</option>
<option value="Market">Market</option>
<option value="Segment">Segment</option>
<option value="Program">Program</option>
<option value="Platform">Platform</option>
</select>
</form>
<script>
function platform() {
mainWorkbook = mainViz.getWorkbook();
// Set to Detail to Platform (aka Type)
mainWorkbook.changeParameterValueAsync('Color Detail', 'Platform').then(function () {
alertOrConsole("'Color Detail' parameter set to Platform");
});
};
</script>
</body>
</html>