1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Solved: form help

Discussion in 'Web Design & Development' started by ms_khw, Jan 23, 2011.

Thread Status:
Not open for further replies.
  1. ms_khw

    ms_khw Thread Starter

    Joined:
    Jul 12, 2004
    Messages:
    1,038
    I googled some free forms and came up with the following. I've managed to edit the html to service my needs, but am a little lost when it comes to some of the code. Hope someone can help. Where do I place the send email results (email address) in the code. And how do I redirect back to a page within my site? I'd appreciate any help on this. The following is the code for the form:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title>Quote Request</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <style type="text/css">
    <!--
    .style2 {font-size: 18px}
    .style4 {font-size: 24px; color: #FFFFFF; }
    body {
    background-color: #FFFFFF;
    margin-top: 10%;
    }
    .style5 {color: #FFFFFF}
    -->
    </style>
    <script language="JavaScript" type="text/JavaScript">
    <!--
    function MM_findObj(n, d) { //v4.01
    var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
    if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[n];
    for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers.document);
    if(!x && d.getElementById) x=d.getElementById(n); return x;
    }

    function MM_validateForm() { //v4.0
    var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
    for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args);
    if (val) { nm=val.name; if ((val=val.value)!="") {
    if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
    if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
    } else if (test!='R') { num = parseFloat(val);
    if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
    if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
    min=test.substring(8,p); max=test.substring(p+1);
    if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
    } if (errors) alert('The following error(s) occurred:\n'+errors);
    document.MM_returnValue = (errors == '');
    }
    //-->
    </script>
    </head>

    <body>
    <table width="800" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#CCCCCC">
    <tr>
    <td valign="top" bgcolor="#1C5396"><p class="style2 style5"><strong>The Pump Shop - Your Water Pump Specialists</strong></p>

    <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td bgcolor="#FFFFFF"><form method=POST action=form2mail.php>
    <table width="500" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#CCCCCC">
    <tr>
    <td><table width="600" border="0" align="center" cellpadding="3" cellspacing="1">
    <tr bgcolor="#FFFFFF">
    <td colspan="2"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><b>Request A Quote</b> </font></td>

    </tr>
    <tr bgcolor="#FFFFFF">
    <td align="right"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Your name: </font></td>
    <td align="left"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">
    <input name="name" type="text" id="name">
    </font></td>
    </tr>
    <tr bgcolor="#FFFFFF">

    <td align="right"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Your email: </font></td>
    <td align="left"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">
    <input name="email" type="text" id="email">
    </font></td>
    </tr>
    <tr bgcolor="#FFFFFF">
    <td align="right"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Phone Number: </font></td>

    <td align="left"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">

    <input name="phone" type="text" id="phone">
    </font></td>
    </tr>
    <tr bgcolor="#FFFFFF">
    <td align="right"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Address: </font></td>
    <td align="left"><input name="address" type="text" id="address"></td>
    </tr>

    <tr bgcolor="#FFFFFF">
    <td align="right"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Please Select the product/service that you are inquiring about <font size="1"><br>
    *use CTRL to select multiple products</font> </font></td>
    <td align="left"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">
    <select name="product info" size="5" multiple id="product info">
    <option>Ultraviolet Systems</option>

    <option>Iron Filters</option>
    <option>Softener Systems</option>
    <option>Reverse Osmosis </option>
    <option>Pump Installation</option>
    <option>Winter Water System</option>
    <option>Water Treatment</option>

    <option>Hot Tubs</option>
    </select>
    </font></td>
    </tr>
    <tr bgcolor="#FFFFFF">
    <td align="right"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">How can we contact you?</font></td>

    <td align="left">
    <font size="2" face="Verdana, Arial, Helvetica, sans-serif">

    <label>
    <input type="radio" name="contact_preference" value="email">
    Email</label>
    <br>
    <label>
    <input type="radio" name="contact_preference" value="phone">

    Phone</label>

    </font></td>
    </tr>
    <tr bgcolor="#FFFFFF">
    <td align="right"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Message:</font></td>
    <td align="left"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">
    <textarea name="message" cols="40" rows="6" id="message"></textarea>
    </font></td>

    </tr>
    <tr bgcolor="#FFFFFF">
    <td colspan="2" align="center"><input name="Submit" type="submit" onClick="MM_validateForm('email','','RisEmail','phone','','RisNum');return document.MM_returnValue" value="Submit"> </td>
    </tr>
    </table>
    </td></tr></table></form></td>
    </tr>
    </table> <p class="style2">&nbsp;</p></td>

    </tr>
    </table>
    </body>
    </html>
     
  2. ehymel

    ehymel

    Joined:
    Aug 12, 2007
    Messages:
    696
    I've never used the script you mentioned, but after googling form2mail.php, I see that in that script you place the information you want at the top of that script. In other words, it's not anywhere in the code you posted, but instead in the script that processes your form. That script is named form2mail.php, and at the top of that script there are 3 variables you need to fill in with your own information.
     
  3. ms_khw

    ms_khw Thread Starter

    Joined:
    Jul 12, 2004
    Messages:
    1,038
    Thanks, I did miss something. I think I know what I did now.
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/976487

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice