Skip to content

Commit

Permalink
fix submit button issues
Browse files Browse the repository at this point in the history
  • Loading branch information
icebob committed Feb 23, 2017
1 parent 15bf501 commit d2e3b07
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
6 changes: 5 additions & 1 deletion dev/full/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,11 @@ module.exports = {
console.log("Form submitted!", model);
alert("Form submitted!");
},
styleClasses: "half-width"
styleClasses: "half-width",
disabled() {
//console.log("Disabled: ", this.errors.length > 0);
return this.errors.length > 0;
}
}, {
type: "select",
label: "Type (select field)",
Expand Down
2 changes: 1 addition & 1 deletion src/fields/core/fieldSubmit.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template lang="jade">
input(type="submit", :value="schema.buttonText", @click="click", :name="schema.inputName")
input(type="submit", :value="schema.buttonText", @click="click", :name="schema.inputName", :disabled="disabled")
</template>

<script>
Expand Down
5 changes: 5 additions & 0 deletions src/formGenerator.vue
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,11 @@ div
box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
}
&:disabled {
opacity: 0.6;
cursor: not-allowed;
}
} // button, input[submit]
} // .field-wrap
Expand Down

0 comments on commit d2e3b07

Please sign in to comment.