Jump to content
Sign in to follow this  
darpaia22

Coding help!

Recommended Posts

I created a contact form utilizing w3schools code but need help figuring out how to make the submit button send the form's information to an email. Below is the code:

 

<meta name="viewport" content="width=device-width, initial-scale=1">
<style type="text/css">body {font-family: Arial, Helvetica, sans-serif;}
* {box-sizing: border-box;}

input[type=text], select, textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
  margin-top: 6px;
  margin-bottom: 16px;
  resize: vertical;
}

input[type=submit] {
  background-color: #4CAF50;
  color: white;
  padding: 12px 20px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

input[type=submit]:hover {
  background-color: #45a049;
}

.container {
  border-radius: 5px;
  background-color: #f2f2f2;
  padding: 20px;
}
</style>
<div class="container">
<form action="/action_page.php"><label for="fname">First &amp; Last Name</label> <input id="fname" name="firstname" placeholder="Your name.." type="text" /><label for="lname">Email</label> <input id="lname" name="lastname" placeholder="john@example.com" type="text" /><label for="info">Marketplace</label> <select id="info" name="info"><option value="—">Please Select</option><option value="Yes">Yes</option><option value="No">No</option></select><label for="info">Leading a Breakout</label> <select id="info" name="info"><option value="—">Please Select</option><option value="Yes">Yes</option><option value="No">No</option></select><label for="info">Volunteering</label> <select id="info" name="info"><option value="—">Please Select</option><option value="Yes">Yes</option><option value="No">No</option></select><label for="info">Other</label><textarea id="subject" name="subject" placeholder="Write something.." style="height:100px"></textarea><input type="submit" value="Submit" />&nbsp;</form>
</div>
 

Share this post


Link to post
Share on other sites

If you want to send an email based on form submission, then you'll need to use a server-side programming language. Try the PHP tutorial, and proceed onto PHP Forms for Form Handling.

Then check out the mail() function after that.

You can take a look at other server side languages but PHP is my bias.

  • Like 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...