Browse Source

Fix form's double submission

tags/v0.1.0
Immanuel Onyeka 3 years ago
parent
commit
f2430088bd
2 changed files with 6 additions and 5 deletions
  1. +5
    -4
      resources/js/register-area/register-area.vue
  2. +1
    -1
      resources/scss/main.scss

+ 5
- 4
resources/js/register-area/register-area.vue View File

@@ -1,5 +1,5 @@
<template>
<form v-if="active === 'register'" v-on:submit="register" id="register-form">
<form v-if="active === 'register'" onsubmit = "event.preventDefault(); return false" id="register-form">
<h3>Registration</h3>
<div>{{errorMessage}}</div>
<div>
@@ -22,7 +22,7 @@
<input v-on:input="checkPasswords" id='confirm-password' required type='password'
name='sender_password' placeholder='' spellcheck='false'>
</div>
<button class="submit-btn" type="submit">Submit</button>
<button @click="register($event)" class="submit-btn" type="submit">Submit</button>
</form>
<form v-if="active === 'forgot'" v-on:submit="forgotPassword" id="forgot-form">
<h3>Forgot Password</h3>
@@ -71,6 +71,8 @@ function getToken() {
}
function register(event) {
/* this.active = 'loading' */
event.preventDefault();
event.stopPropagation();
this.getToken().then(() => {fetch("/register", {
method: 'POST',
headers: {'Content-Type': 'application/json',
@@ -96,9 +98,8 @@ function getToken() {
}
/* console.log(response.json()) */
});
event.preventDefault();
event.stopPropagation();
})
return false
}

function checkPasswords() {


+ 1
- 1
resources/scss/main.scss View File

@@ -567,7 +567,7 @@ section.features-info {
}

div.register-area.active {
min-height: 400px;
min-height: 35em;
opacity: 1;
}



Loading…
Cancel
Save