fix empty contact form submit

master
Ayush Mukherjee 4 years ago
parent fc0dc3c4fa
commit 03acfc80b0

@ -211,6 +211,9 @@ export default {
methods: { methods: {
submitForm() { submitForm() {
event.preventDefault() event.preventDefault()
if(this.name == null || this.email == null || this.message == null)
alert('Your name, email, or message cannot be empty.')
else {
document.querySelector('input[type=text]').disabled = true document.querySelector('input[type=text]').disabled = true
document.querySelector('input[type=email]').disabled = true document.querySelector('input[type=email]').disabled = true
document.querySelector('textarea').disabled = true document.querySelector('textarea').disabled = true
@ -232,5 +235,6 @@ export default {
}) })
} }
} }
}
} }
</script> </script>

Loading…
Cancel
Save