πHow To Make Working Contact Form With JavaScript
The steps to create a simple HTML JavaScript contact form:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Contact Form</title>
</head>
<body>
<!--form here -->
<form id="contact-form" method="POST" action="sendmail.php">
<div class="form-row form-error" style="display:none;"></div>
<div class="form-row">
<label for="contact-form-name">Name:</label>
<input id="contact-form-name" class="form-input" type="text" name="name" required>
</div>
<div class="form-row">
<label for="contact-form-email">Email:</label>
<input id="contact-form-email" class="form-input" type="email" name="email" required>
</div>
<div class="form-row">
<label for="contact-form-phone">Phone:</label>
<input id="contact-form-phone" class="form-input" type="tel" name="phone">
</div>
<div class="form-row">
<label for="contact-form-message">Message:</label>
<textarea id="contact-form-message" class="form-input" name="message" required></textarea>
</div>
<button type="submit">Submit</button>
</form>
</body>
</html>
PreviousHow to automate sending daily email reports in Python, and how I would set it up.NextHow to Create a header line that appears when a user scrolls using HTML, CSS, and JavaScript
Last updated