Ok, I have a Highcharts.js page that currently loads its data from making an api call that contains a query of the database. My issue is that the query needs to be able to have user input in order for them to be able to get the graph of what they are looking for (in this case it would be an input of a station ID
The HTML
<!-- Page Content -->
<div id="page-content-wrapper">
<div class="container-fluid">
<div class="row">
<div class="col-lg-12">
<h1>Sidebar</h1>
<div id="container" class="resize" style=" width: 100%; height: 100%; margin: 0 auto "></div>
<a href="#menu-toggle" class="btn btn-default" id="menu-toggle">Toggle Menu</a>
<input type="text" id="q" />
<input type="button" id="submit" value="submit" />
</div>
</div>
</div>
</div>
<!-- /#page-content-wrapper -->
$(function () {
$('#submit').click(function() {
sgaxml = 'https://sga.quickbase.com/db/bjmdensiu?apptoken=beadyrucxguavbx5isubd6iaqpe&act=API_DoQuery&query={14.EX.';
sgaxml += $('#q').val();
sgaxml += '}&clist=7.24.25.26.27.28.29.30.31.32.33.34.35.36.37';
console.log(sgaxml); }
};
At one point using this I was able to confirm that it was making the input the url, but I couldn't it to work as a variable for the charts call
$.get(sgaxml, function(xml) {
// Split the lines
var xml = $(xml).find('record');
Also, sgaxml is declared (var sgaxml = '') globally.
I have tried it a few different ways and can't decide if I am going completely the wrong direction for what I am trying to do or if I am just making it more complicated than it needs to be. I left out my chart data as the data itself for the chart works (when it's fed information), but if you would like to see the whole thing I will comment it.