Skip to content

Commit

Permalink
Fixed email
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisBit committed Mar 5, 2020
1 parent 20d43d6 commit 5f1a43a
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions src/components/ContactForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,8 @@ const ContactForm = () => {
const [info] = useState({
to: 'contact@peterstenberg.no',
subject: 'Mail from peterstenberg.no',
email: '',
thanks: 'https://www.peterstenberg.no',
});
const [form, setForm] = useState();

const onFieldChange = (fieldName, event) => {
setForm({ [fieldName]: event.target.value });
};

const handleSubmit = (event) => {
event.target.style.opacity = '1';
Expand All @@ -30,7 +24,6 @@ const ContactForm = () => {
>
<div className={'input-container'}>
<input type="hidden" name="_to" value={info.to} />
<input type="hidden" name="_from" value={info.email} />
<input type="hidden" name="_subject" value={info.subject} />
<input type="hidden" name="_resulturl" value={info.thanks} />
<input
Expand All @@ -42,14 +35,12 @@ const ContactForm = () => {
required
/>
<input
value={info.email}
type="email"
name="email"
name="_from"
title="Please provide a correct e-mail address. Ex: mail@example.com"
pattern="^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*(\.\w{2,})+$"
placeholder="E-MAIL*"
required
onChange={(e) => onFieldChange('email', e)}
/>
<input type="tel" name="phone" placeholder="PHONENUMBER" />
<label htmlFor="message">MESSAGE*</label>
Expand Down

0 comments on commit 5f1a43a

Please sign in to comment.