Skip to content
Snippets Groups Projects
SubscribeNewsletter.js 900 B
Newer Older
import React, { useState } from 'react'
import '../css/additional/custom.css';

export default function SubscribeNewsletter({formPostUrl}) {
  
    const [formSubmitted, setFormSubmitted] = useState(false);

    

    const handleSubmit = (e) => {
        setFormSubmitted(true);
    }

    return (
        <form method="POST" action={formPostUrl} className="subscribe-form" onSubmit={handleSubmit}>
            <label htmlFor="fullname">Name</label>
            <input type="text" name="fullname" placeholder="(optional)" maxLength="64"></input><br />

            <label htmlFor="email">E-Mail</label>
            <input type="text" required name="email" placeholder="beispiel@example.com" maxLength="64"></input><br />

            <input type="submit" disabled={formSubmitted} className="get-subscribe" name="email-button" value="Abonnieren"></input>
                   
        </form>
    )
}