Disable demo submit button and add link to contact

This commit is contained in:
bumi 2020-04-13 16:14:21 +02:00
parent 64031261c5
commit 80771e7415
3 changed files with 10 additions and 4 deletions

View File

@ -3,10 +3,13 @@ document.addEventListener('DOMContentLoaded', function() {
if (!demoForm) {
return;
}
demoForm.addEventListener('submit', function(e) {
var submitButton = document.getElementById('demo-submit');
submitButton.innerText = 'loading...';
submitButton.disabled = 'true'
});
demoForm.addEventListener('tinyforms:submitted', function(e) {
console.log(e);
console.log(e.detail);
var name = document.getElementById('demo-submission-name');
var demoFields = document.getElementById('demo-fields');
var demoSucess = document.getElementById('demo-success');

View File

@ -15,7 +15,9 @@
</p>
<p>See your entry in the spreadsheet?!</p>
<p>
<%= link_to "Get started now", signup_url, class: 'button' %>
<%= link_to "Create your form now!", signup_url, class: 'button' %>
<br>
or got <%= link_to 'further questions?', contact_url %>
</p>
</div>
@ -68,7 +70,7 @@
<div class="field is-grouped">
<div class="control">
<button class="button is-link">Submit</button>
<button class="button is-link" id="demo-submit">Submit</button>
</div>
</div>
</div>

View File

@ -22,5 +22,6 @@ Rails.application.routes.draw do
get '/auth' => 'sessions#auth', as: :auth
get '/demo' => 'home#demo', as: :demo
get '/contact' => 'home#contact', as: :contact
root 'home#index'
end