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
@ -233,4 +236,5 @@ export default {
} }
} }
} }
}
</script> </script>

Loading…
Cancel
Save