Hey, @perry.
Unfortunately I’ve tried to search, but couldn’t find anyone with the same problem. If all fields were empty, i guess it would be different. Also, as I mentioned, I can see that all the fields with the correct data is being sent in the request on submit, so I’m out of ideas tbh. The code on this side seems to work.
Here is the form code:
<form
name="contact"
method="post"
// action="/thanks/"
data-netlify="true"
data-netlify-honeypot="bot-field"
onSubmit={handleSubmit}
className={styles.form}
>
<input type="hidden" name="form-name" value="contact" />
<p hidden>
<label>
Don’t fill this out: <input name="bot-field" onChange={handleChange} />
</label>
</p>
<input
className={((displayMsg && errors.customername) ? `${styles.errorBox}` : '')}
type="text"
placeholder="Name"
name="customername"
value={customername}
onChange={(event) => handleChange(event)}
/>
{displayMsg && <span className={styles.error}>{errors.customername}</span>}
<input
className={((displayMsg && errors.email) ? `${styles.errorBox}` : '')}
type="text"
placeholder="Email"
name="email"
value={email}
onChange={(event) => handleChange(event)}
/>
{displayMsg && <span className={styles.error}>{errors.email}</span>}
<textarea
className={((displayMsg && errors.message) ? `${styles.errorBox}` : '')}
placeholder="Message"
name="message"
value={message}
onChange={(event) => handleChange(event)}
/>
{displayMsg && <span className={styles.error}>{errors.message}</span>}
<button
disabled={!customername || !email || !message}
>SEND</button>
{mailSent === true &&
<div className={styles.confirmed}>
<p>Thrilled to hear from you! </p>
<p>I will get back to you shortly</p>
</div>
}
</form>
Hopefully you can see something I can’t, if not - thanks for the effort anyways.