Fix convertForm submit

This commit is contained in:
Tom Lee 2017-06-09 20:21:43 -07:00
parent 7e2150cf0b
commit 704a42e70f

View File

@ -46,7 +46,7 @@
<h2 style="text-align: left">Front-End:</h2>
<form id="convertForm" class="border">
<input type="text" id="convertField" name="input" placeholder="3.1mi" style="width: 200px">
<button id="convert" type="button">Convert!</button>
<input id="convert" type="submit" value='Convert!'>
</form>
<p id='result'></p>
<code id='jsonResult'></code>
@ -58,7 +58,8 @@
crossorigin="anonymous"></script>
<script>
$(function() {
$('#convert').click(function() {
$('#convertForm').submit(function() {
event.preventDefault();
$.ajax({
url: '/api/convert',
type: 'get',