Jump to content

HTML form submit button


OllieD
 Share

Recommended Posts

I have st up a form on my website for contacting my company. It has some required fields for name, email and message but when you click the submit button, an alert pops up to confirm the form being submitted even when the required fields haven't been filled out. How can I solve this?

 

This is the code for the form:

 

<form name="Contact" method="put" id="contact">
First Name: <input type="type" name="First" id="first" maxlength="20" required placeholder="First Name">
<br>
Last Name: <input type="type" name="Last" id="last" maxlength="25" required placeholder="Last Name">
<br>
Email: <input type="email" name="Email" id="email" maxlength="25" required placeholder="Email">
<br>
Message <input type="type" name="Message" id="message" maxlength="1000" required placeholder="Message">
<br>
<input type="reset">
<input type="submit" onClick="alert('Thank you for contacting us. We will process it as soon as possible')">
</form>
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...