I have a simple form ...
<form id="myForm" >
<div>
<label for="airport">Airport:</label>
<input type="text" id="airport" />
</div>
<div class="button">
<button id="submit" type="submit">Submit</button>
</div>
</form>
I am trying to send a json request. When I hard code the url with parameters, it works fine. As soon as I try and add the parameter from my form, on submit..it breaks. I've tried every suggestion I can find..nothing seems to work. I'm not an expert with jquery/javascript and just learning about json. Any help would be appreciated. Thanks in advance. This is my working request...but I'd like to add the form field #airport instead of hard coding the name of the airport, ATL, in the json url string.
$(function () {
$.getJSON('http://services.faa.gov/airport/status/ATL?format=json', function(data) {
var output;
output = data.state + " | " + data.name + " | " + data.IATA + " | " + data.status.reason + "<hr />";
document.getElementById("placeholder").innerHTML = output;
});