I have gone through the steps provided in the README and netlfiy documentation and Netlify currently watches a Github repo to build. Even though the deploy log shows detection of form inputs, the bots appear to not update the form with a hidden input and removal of data-netlify=true from the form element when checking the browser DevTools.
"nuxt": "^2.15.6"
"@nuxtjs/netlify-files": "^1.2.0" (in the devDependencies)
<template lang="pug">
MainWrap
Section(sectionTitle='Reach Out!')
A-BodyText(
content='I am available for private consultation with web design and development, or if you need a new developer on your team! Simply fill out the form below and I will contact you in the next 24-48 hours.<br/><strong>Thank you!</strong>'
class='max-w-md mx-auto'
)
form(
class='max-w-[400px] mx-auto'
@submit='checkSubmit'
name='contact'
data-netlify=true
novalidate='true'
method="POST"
)
//- Input field for Full Name
M-FormPair(
:isError='errors.name'
pairId='name'
label='Full Name'
inputType='text'
v-model='name'
)
//- Input field for Email
M-FormPair(
:isError='errors.email'
pairId='email'
label='Email Address'
inputType='email'
v-model='email'
)
//- Multiline field for User Message
M-FormPair(
isTextArea
:isError='errors.message'
pairId='message'
label='Your Message'
v-model='message'
)
div(class='flex mt-4 flex-center')
A-Button(buttonType='form' type='submit' appearance='primary' content='Send')
</template>
<script>
export default {
data() {
return {
errors: {},
// Below data acquired from v-model directives
name: '',
email: '',
message: '',
};
},
head() {
return {
title: 'Reach Out!',
};
},
methods: {
checkSubmit(event) {
this.errors = {};
if (!this.name) {
this.errors.name = 'Name required.';
} else if (!this.validName(this.name)) {
this.errors.name =
'Please provide a first and last name with no extra special characters.';
}
if (!this.email) {
this.errors.email =
'Email field empty. Please provide an email address';
} else if (!this.validEmail(this.email)) {
this.errors.email = 'Not a valid email';
}
if (!this.message || !this.validMessage(this.message)) {
this.errors.message = 'Message to Tyler required with no leading space';
}
// If no errors are pushed
if (!Object.keys(this.errors).length) {
// return true to push submit and skip preventDefault action
return true;
}
// Place preventDefault last to ensure that form does submit when name and email return true
event.preventDefault();
},
validName(name) {
const re = /^[a-zA-Z.]+\s[a-zA-Z]+(\s[a-zA-Z.]+)?$/;
return re.test(name);
},
validEmail(email) {
const re =
/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
return re.test(email);
},
validMessage(message) {
const re = /^\S.+\S$/;
return re.test(message);
},
},
};
</script>
<style lang="postcss" scoped>
.input-base {
@apply py-[5px] px-2 border border-gray-500 rounded-sm shadow focus:border-[#FFB700] focus:outline-none;
}
</style>
- `"tailwindcss": "^2.1.4"`, `"pug": "^3.0.2"`, and `"pug-plain-loader": "^1.1.0"` are involved in this page on build.
- The build section of the Netlify deploy log:
![image](https://user-images.githubusercontent.com/65234762/122616666-ca05a880-d058-11eb-8ae4-e81ae7ed7d36.png)
Thank you for any assistance and suggestions!
Hello!
I have gone through the steps provided in the README and netlfiy documentation and Netlify currently watches a Github repo to build. Even though the deploy log shows detection of form inputs, the bots appear to not update the form with a hidden input and removal of
data-netlify=true
from theform
element when checking the browser DevTools."nuxt": "^2.15.6"
"@nuxtjs/netlify-files": "^1.2.0"
(in the devDependencies)buildModule
The
contact.vue
page that is applying netlify: