67

static-contact-validatedForm

 5 years ago
source link: https://www.tuicool.com/articles/hit/vueU7nv
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

iQfqequ.png!web

What is its use?

You can add a contact form in your static website like site hosted on Github and able to get response from user.

Some Cool Features

Sometimes people try to span your email and you get anonymous emails. To avoid this, I have created this so that one has to authenticate their emails before sending message to you.

  • Avoid Spam emails
  • Can add as many name fields in your HTML form.
  • Get IP address of the sender

Preview

RFRjmua.gif

How to use

1.) fork the repository

2.) Host it on any domain you want, I would suggest Glitch

3.) Add an .env file in your root folder for reference see .env.example

4.) Add this to form in your static site

In action field of form add your hosted URL/verify , where hosted URL is one when you host the code on Glitch, Herkou, AWS type services.

<form method="GET" action="your hosted URL/verify" accept-charset="UTF-8" >
  <input id="name" type="text" name="name" required placeholder="Example:- Messi | Ronaldo">
  <input id="email" type="email" name="email" placeholder="Example:- [email protected]" required>                
  <textarea id="textarea" name="message" placeholder="Enter your message" required ></textarea>
  <button type="submit">Send</button>
</form>

namefield in html form for email field is mandatory. Rest you can add as many as you want.

:fire: Enjoy.

license

MIT @knrt10


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK