HTML - Issues With Contact Form For Subscriptions
I am attempting to incorporate a contact form that will send an email to a particular email address with the filled out info. Also, I need that contact form to transfer to another page of the site that will allow for payment to be collected via paypal. I understand the protocol to make the contact form to send an email but getting that form to also transfer to another page is where I am stuck. I also know how to incorporate the paypal button to receive payment. I just do not know how I can incorporate both to make it a smoother process. Unless there's a way I can put the paypal button on the contact form so that it sends the email with the info and sends them to paypal to finish the transaction? Any ideas?
Here the html for my contact form: Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>Preview Form</title> <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> <meta http-equiv="Content-Style-Type" content="text/css"> <meta http-equiv="Content-Script-Type" CONTENT="text/javascript"> <script type="text/javascript"> window.onload = function() { document.getElementById("form1").onsubmit = function() { return checkRegex(); } } function checkRegex() { var isValid = true; var thisValid = new Array(); var ids = new Array(); var texts = new Array(); var regex = new Array(); var errorMsg = new Array(); ids[0] = new Array("box1","address1","state","city1","zip1","email1"); texts[0] = new Array("Name","Address","State","City","Zip Code","Email"); regex[0] = /^[^/\s].*/; errorMsg[0] = "[label] cannot be blank"; ids[1] = new Array("zip1"); texts[1] = new Array("Zip Code"); regex[1] = /^[0-9]+$/; errorMsg[1] = "[label] must be a number"; ids[2] = new Array("box1","city1","state"); texts[2] = new Array("Name","City","State"); regex[2] = /^[a-zA-Z\s]+$/; errorMsg[2] = "[label] can only contain letters/spaces"; ids[3] = new Array("address1"); texts[3] = new Array("Address"); regex[3] = /^[a-zA-Z0-9\s]+$/; errorMsg[3] = "[label] can only contain letters/numbers/spaces"; ids[4] = new Array("box1"); texts[4] = new Array("Name"); regex[4] = /^[\w]+$/; errorMsg[4] = "[label] can only contain letters/numbers/underscore"; ids[5] = new Array("email1"); texts[5] = new Array("Email"); regex[5] = /^[_A-Za-z0-9-]+(\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)*$/; errorMsg[5] = "[label] must be an email address"; for (var i = 0; i < 6; i++) thisValid[i] = applyRegex(regex[i], ids[i], texts[i], errorMsg[i]); for (i = 0; i < thisValid.length; i++) isValid = isValid && thisValid[i]; return isValid; } function applyRegex(regex, ids, texts, errorMsg) { var obj, thisValid = true; for (var i = 0; i < ids.length; i++) { obj = document.getElementById(ids[i]); removeErrorDiv(ids[i]); if (obj.value.match(regex) == null) { var errorStr = errorMsg.replace("[label]", texts[i]); addErrorDiv("contains_" + ids[i], errorStr, "98%"); thisValid = false; } } return thisValid; } function addErrorDiv(domID, msg, width) { var add = true; var target = document.getElementById(domID); var errorDiv = document.createElement("div"); var errorDivID = "error_" + domID; if (document.getElementById(errorDivID)) return; errorDiv.setAttribute("id", errorDivID); errorDiv.className = "validation_error"; errorDiv.style.width = width; errorDiv.style.padding = "1%"; errorDiv.innerHTML = msg; target.appendChild(errorDiv); } function removeErrorDiv(domID) { var errorDivID = "error_contains_" + domID; if (document.getElementById(errorDivID)) { var child = document.getElementById(errorDivID); var parent = document.getElementById("contains_" + domID); parent.removeChild(child); } } </script> <style type="text/css"> div#preview { width: 400px; margin: 40px auto; } div#preview div#back { width: 400px; float: left; clear: both; padding-top: 40px; text-align: center; } form#form1 {float: left; margin: 0; padding: 0; display: inline; width: 400px; } form#form1 div {float: left; margin: 0; padding: 0; display: inline; } form#form1 p {float: left; margin: 0; padding: 0; display: inline; } form#form1 label {float: left; margin: 0; padding: 0; display: inline; overflow: hidden; } form#form1 input {float: left; margin: 0; padding: 0; display: inline; } form#form1 p#contains_box1 {clear: both; width: 400px; } form#form1 p#contains_box1 label {clear: both; width: 400px; } form#form1 p#contains_box1 input {clear: both; width: 396px; } form#form1 p#contains_address1 {clear: both; width: 400px; } form#form1 p#contains_address1 label {clear: both; width: 400px; } form#form1 p#contains_address1 input {clear: both; width: 396px; } form#form1 p#contains_city1 {clear: both; width: 400px; } form#form1 p#contains_city1 label {clear: both; width: 400px; } form#form1 p#contains_city1 input {clear: both; width: 396px; } form#form1 p#contains_state {clear: both; width: 400px; } form#form1 p#contains_state label {clear: both; width: 400px; } form#form1 p#contains_state input {clear: both; width: 396px; } form#form1 p#contains_zip1 {clear: both; width: 400px; } form#form1 p#contains_zip1 label {clear: both; width: 400px; } form#form1 p#contains_zip1 input {clear: both; width: 396px; } form#form1 p#contains_email1 {clear: both; width: 400px; } form#form1 p#contains_email1 label {clear: both; width: 400px; } form#form1 p#contains_email1 input {clear: both; width: 396px; } form#form1 p#contains_submit1 {clear: both; width: 400px; } form#form1 p#contains_submit1 input {clear: both; width: 400px; } form#form1 div.validation_error { padding: 1%; } </style> </head> <body> <div id="preview"> <form id="form1" name="sub" method="get" action="collect" enctype="application_x-www-form-urlencoded"> <p id="contains_box1"> <label for="box1">Name</label> <input id="box1" type="text" name="box1" /> </p> <p id="contains_address1"> <label for="address1">Address</label> <input id="address1" type="text" name="address1" /> </p> <p id="contains_city1"> <label for="city1">City</label> <input id="city1" type="text" name="city1" /> </p> <p id="contains_state"> <label for="state">State</label> <input id="state" type="text" name="state" /> </p> <p id="contains_zip1"> <label for="zip1">Zip Code</label> <input id="zip1" type="text" name="zip1" /> </p> <p id="contains_email1"> <label for="email1">Email</label> <input id="email1" type="text" name="email1" /> </p> <p id="contains_submit1"> <input type="submit" name="submit1" id="submit1" value="Submit" /> </p> </form> <div id="back"> </div> </div> </body> </html> Similar TutorialsHi, I'm planning on creating a feature on a website where viewers can subscribe to a newsletter. Does anyone have any tutorials that can help with this? I've never dealt with that before and I know some hosting services offer mailing lists, but I was wanting some information on how you actually go about putting the code onto the site so people can enter their e-mail in a form and hit "subscribe" and receive the e-mails. Thank you Hello guru's, I have created a contact form on the website, but i dont know how to send the information that the users has typed to my email address What code do i need to type? Can someone please let me know where I can find a free contact form for my site. All I want is a simple form - eg: Name: Email: Message: Send: If possible a form that I can copy and paste right onto my site, thanks! For my website i want to create a table/form where people can fill in thier email, a comment and it sends it to my emai without them actualy knowing my email addressl, any idea how i can do this? Many Thanks, Narc I'm new to this so I'm going to post the template I found and then hopefully someone can make it right. Will upload two text files first is the contact page its an html file. the other is the contact script as a php file. Sorry if this has been brought up before but i've been trying now for about 6 hours. Thank you Bill Ruiter is there something wrong with this code im not recieving emails <form name=contactme action=contactme.php method=post> <div align="center"> <table> <tr> <td align=right>Name:</td> <td width="15"> </td> <td><input size=45 maxlength=45 type=text name=name style="font-family: Courier New; font-size: 10pt"></td></tr> <tr> <td align=right>Email:</td> <td> </td> <td><input size=45 maxlength=45 type=text name=from style="font-family: Courier New; font-size: 10pt"></td></tr> <tr> <td align=right>Subject:</td> <td> </td> <td><input size=45 maxlength=90 type=text name=subject style="font-family: Courier New; font-size: 10pt"></td></tr> <tr> <td valign=top align=right>Contents:</td> <td> </td> <td><textarea name=body rows=12 cols=60 style="font-family: Courier New; font-size: 10pt"></textarea></td></tr> <tr> <td> </td> <td> </td> <td><input type=submit value=" Submit " name=submit style="font-size: 10pt; font-family: Tahoma"></td></tr> </table> </div> </form> I would like someone to help me get the email form on the html page working. I am so lost! http://hershs-salsa.com/locations.html Not sure if this is the right place but I was just wondering if anyone could help me. I'm trying to make an option on my contact form that when you click it, it affects whether you have to enter the other fields or drop-down box. For example and simply put, if someone clicked the box labeled 'red', then it would be required for them to fill out the box that says 'explain your choice'. However if they do not click red, then they do not need to fill out the 'explain your choice' box... How do I do this? Is there a name for it? Thanks for any help Hello everyone, I know this might sound easy but I can't remember how to do this. Does anyone know how to send information from a simple form by hitting the submit button and I should be able to view the data in my domain email? I guess you can say I can check my email and the name, email and message form fields would displayed. I've created the form, form fields and the buttons in dreamweaver. I'm not sure if the enctype is ="multipart/form-data" I've done this before in front page. it come out as a web bot but i cant remember how this works in dreamweaver. I hope I haven't confused anyone. Please reply if you know what I'm talking about. Thank you. Here is the code below from my contact.html page: <form action="thankyou.asp" method="post" enctype="text/plain" name="contactform" target="_blank"> <span class="formstitle">Name:</span><br> <input name="textfield" type="text" class="formstitle2" size="30" maxlength="30"> <br> <br> <span class="formstitle">Email:</span><br> <input class="formstitle2" name="email" type="text" id="email" size="30" maxlength="30"> <br> <br> <span class="formstitle">Message:</span><br> <textarea name="message" cols="30" rows="4" class="formstitle2" id="message"></textarea> <br> <br> <input name="Submit" type="image" value="Submit" src="images/submit.gif" alt="submit" width="56" height="28"> <input type="image" src="images/clear.gif" alt="clear" width="56" height="28"> <br> </form> Hi guys, i'm here with another question, I need to make a contact form for my website, I posted this at html section but i'm not sure, some people say it's html, some php some say it's both... So I googled a bit and all I find are things like this: Code: <form method="post" action="mailto:youremail@email.com"> <textarea rows="5" cols="20" wrap="physical" name="comments"> Enter Comments Here </textarea> <input type="submit" value="Send Email"> </form> This just opens windows live mail..I want to people just click a button "send email" and it sends to my email, nothing more...not this confusions...i've been googling and I find nothing, so I want to talk to the experts, which are you guys I want to be able to have three boxes that a visitor can enter input and it be emailed to me. For example: Name - (Visitor types in name) Email - (Visitor types in email) Question - (Visitor types in question) Than they hit Submit and it is emailed to me. I have found code that uses Outlook to do it, but I want it to do it through the website. I'm trying to create a form for my website that will email me the information when submitted. I don't know if this can be done in HTML. I cant use PHP on my forum so it cant be that. The other option i have is one coded in JavaScript. Anyone know where i can either get a html or JavaScript code for such a thing please. Thanks Jake Hello, I am working on a contact page and was wondering if someone could help me with the following. I have created my form in html already with minor look changes in css (nothing big). I would like to write a javascript that will first validate the manditory fields (Name, email, and the message) after which it will compile all entered data into a popup/new page that JUST shows the information to be copy and pasted to an email; then later sent off. For example if someone enters their name, email, location and message, the javascript will accept the form due to all the mandatory fields being present, and then depending on what the user input in the input fields, it will output something like the following on a new page or window: COPY AND PASTE BELOW THIS LINE --------------------------------------------------- Name: So and So Email: name@email.com Location: Country Message: Message is whatever length. --------------------------------------------------- I do have basic java knowledge so im not a total newbie. Thank you for all help; hope this isnt too daunting a task for you all. Just a little insight needed. Thanks again, -Alim Alright, i'm having a problem with this contact form. I made it so that it will send to your email. But when I submit, its supposed to say on a new page "Your message has been sent.", but when I send it, all it says is "'); header('Location: sent.html'); ?>". Here is the codes: Code: <html> <head> <title>Contact</title> </head> <body> <form action="form.php" method="post"> Name<br/><input type="text" name="name" /><br/> Email<br/><input type="text" name="email"/><br/> Message<br><textarea row="7" cols="70" name="message"></textarea><br/> <input type="submit" value="Submit" /> </form> </body> </html> Code: <?php $name = $_POST['name']; $email = $_POST['email']; $text = $_POST['mesasge']; mail('EMAILHERE', 'message, $text, 'From: ' . $name . ' <' . $email . '>'); header('Location: sent.html'); ?> Code: <html> <head> <title>Sent</title> </head> <body> Your message has been sent. </body> </html> Help will be appreciated. Thanks for your time. Hi I want to add a CAPTCHA to my contact form as i have been getting hit badly by spammers was wondering if any one could give me some advice or script on how to do that....thanks in advance somebody can tell me wich reason the contact form i have setting doesn't send email thanx http://users3.Jabry.com/Bothofus/Css...ontactform.htm and here same : http://boudhatour.wapath.com/Contact...ontactform.htm i bought this template and going well, but i am stuck with the contact page, i want the user to be able to fill the contact form and send it to my mailbox.. yes i have tried it myself and also build my own contact.php . But the template coding is a bit confusing for me Code: <div id="content"> <div class="bg-cont png"> <div class="indent-main"> <div class="container"> <div class="col-1"> <div class="box"> <form action="" id="form2"> <div class="indent-box"> <img alt="" src="images/6page_title1.gif" class="title1" /><br /> <div class="h1"><input type="text" class="input1" value="Name: " /></div> <div class="h1"><input type="text" class="input1" value="E-Mail: " /></div> <div class="h1"><input type="text" class="input1" value="Phone:" /></div> <div class="h1"><input type="text" class="input1" value="State:" /></div> <textarea rows="40" class="textarea" cols="30" value="Message:">Message:</textarea><br /> <div class="fright"> <a href="#" class="link-1" onclick="document.getElementById('form2').reset()"><em><b>Reset</b></em></a> <div class="indent-2"><a href="#" class="link-1" onclick="document.getElementById('form2').submit()"><em><b>Send</b></em></a></div> </div> <div class="clear"></div> </div> </form> </div> so lets say i make a contact.php and i will change it to <form action="contact.php" id="form2"> how about this line: what should i replace with "a href?????? " Code: <div class="fright"> <a href="#" class="link-1" onclick="document.getElementById('form2').reset()"><em><b>Reset</b></em></a> <div class="indent-2"><a href="#" class="link-1" onclick="document.getElementById('form2').submit()"><em><b>Send</b></em></a></div> and here is my contact.php page... it doesn't work properly Code: <?php $name = $_POST['Name']; $email = $_POST['E-Mail']; $phone = $_POST['Phone']; $state = $_POST['State']; $Message = $_POST['Message']; $to = "gilbylu@gmail.com"; $subject; $message = ""; foreach($_POST as $key=>$value) { $message .= $key.": ".$value."\n\r"; } mail($to,$subject,$message); ?> <html> <head> <title> Contact - Message Sent</title> <body> Message Sent Succesfully. </body> </html> ................................................................................................. Howdy everyone, I've been lurking HTMLForum for awhile and now I have a problem that I cannot find in the forums... So I downloaded an html/css template for a website i was working on and it has a nice contact form but I cannot figure out how to get it to send me the emails when a user fills it out. The website is http://www.piperroofingandvinylsidin...contactus.html (my family's company). code: <h3>Contact Form</h3> <div id="cp_contact_form"> <form method="post" name="contact" action="#"> <label for="author">Name:</label> <input name="author" type="text" class="input_field" id="author" maxlength="60" /> <div class="cleaner_h10"></div> <label for="email">Email:</label> <input name="email" type="text" class="input_field" id="email" maxlength="60" /> <div class="cleaner_h10"></div> <label for="subject">Phone:</label> <input name="subject" type="text" class="input_field" id="subject" maxlength="60" /> <div class="cleaner_h10"></div> <label for="text">Message:</label> <textarea id="text" name="text" rows="0" cols="0" class="required"></textarea> <div class="cleaner_h10"></div> <input type="submit" class="submit_btn float_l" name="submit" id="submit" value="Send" /> <input type="reset" class="submit_btn float_r" name="reset" id="reset" value="Reset" /> </form> </div> </div> I appreciate everyone's time - Happy HTML'ing! Hi, I'm working on a contact form and its almost finished. There are 2 main offices the form can go to. for example UK office and France office. I want to add 2 check boxes or radio boxes so that the person filling out the form can choose which office they want the form to go to. Is this possible and if so anyone got exampel code i can use to add to my form and mail.php script? |