I need to grab a variable from a form when the button is clicked, and then process other functions.
This is the error:
jquery.min.js:6 Uncaught RangeError: Maximum call stack size exceeded
Here's the JQuery:
$(document).ready(function(){
var value;
var callMe = function(){
value = document.getElementsByClassName("instr");
}
$('#container :button').click(function(event){
callMe();
doAjax(value);
});
});
More JQuery. There's more if it's needed.
function doAjax(value) {
//var value , ajax;
var ajax;
//value = 'CCBOT'; // This variable works when hard coded.
//Pass the values to the AJAX request and specify function arg for 'done' callback
ajax = theAjax(value);
ajax.done(processData);
ajax.fail(function( jqXHR, textStatus, errorThrown) {
//Output error information
});
}
Here's the html form:
<div id="container" class="center">
<form>
<label for="instr">Select Instrument</label>
<select name="instr" id="instr" class="instr" value="">
<option value="WHCBOT">WHEAT-SRW - CHICAGO BOARD OF TRADE</option>
<option value="WHMGE">WHEAT-HRSpring - MINNEAPOLIS GRAIN EXCHANGE</option>
<option value="CCBOT">CORN - CHICAGO BOARD OF TRADE</option>
<option value="OCBOT">OATS - CHICAGO BOARD OF TRADE</option>
</select>
<input id="button" type="button" value="Get Chart">
</form>
<div id="response-container">
The chart will appear here..
</div>
</div>
theAjax?