Merge pull request #1 from user512/fix/convert-form
Fix convertForm submit
This commit is contained in:
commit
baecd043aa
@ -46,7 +46,7 @@
|
|||||||
<h2 style="text-align: left">Front-End:</h2>
|
<h2 style="text-align: left">Front-End:</h2>
|
||||||
<form id="convertForm" class="border">
|
<form id="convertForm" class="border">
|
||||||
<input type="text" id="convertField" name="input" placeholder="3.1mi" style="width: 200px">
|
<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>
|
</form>
|
||||||
<p id='result'></p>
|
<p id='result'></p>
|
||||||
<code id='jsonResult'></code>
|
<code id='jsonResult'></code>
|
||||||
@ -58,7 +58,8 @@
|
|||||||
crossorigin="anonymous"></script>
|
crossorigin="anonymous"></script>
|
||||||
<script>
|
<script>
|
||||||
$(function() {
|
$(function() {
|
||||||
$('#convert').click(function() {
|
$('#convertForm').submit(function() {
|
||||||
|
event.preventDefault();
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: '/api/convert',
|
url: '/api/convert',
|
||||||
type: 'get',
|
type: 'get',
|
||||||
|
Loading…
Reference in New Issue
Block a user