Log in

View Full Version : How to create email form? plz help desperately



newj
02-09-2007, 03:49 PM
hello guys,

am new to scripting but know the designing part very well. I am stuck with an enquiry form which has to be emailed by users online. I am unable to receive any mails in my mailbox. Am I doing something wrong. PLzzz help me in this.

i am going to send the attachements

am using frames (though I am unhappy with it)

plzzz help me with this. I am truely stuck and have high hope with the people in this forum.

thnx

Masterskinnie
02-09-2007, 04:36 PM
It is done like this:


<a href="mailto:your email here in quotes before mailto: and after email">Hyperlink text you want visible</a>


I'll send an e-mail. plz say if you received it. I'll look at your code too to see what you have

Masterskinnie
02-09-2007, 04:44 PM
The way you have it set up, it is best for you to use javascript. I'll write the code, test it, email it to you and tell you how to set it up.

Tell me where you put your code together on (whether it waas notepad or html editor(plz specify))

thetestingsite
02-09-2007, 04:45 PM
I would suggest (if you want to use a form that is) using a server side language along with your form. If you look around the PHP forums, there are tons floating around. Make sure you can run server side scripts with your host, or else this will not work. Otherwise, use the above posted code (the mailto link).

Hope this helps.

newj
02-11-2007, 11:37 AM
Thanks Masterskinnie! I use dreamweaver entirely while doing a site. Is something wrong with my form? can i use PHP in this? how? can u help me in this.
BTW, I havent got ur email.

Shotgun Ninja
02-12-2007, 02:09 PM
Hey, I've been having the same problem, and I still haven't gotten an answer on it. Tell me when you guys have a solution.

chechu
02-14-2007, 01:58 PM
Nice site, newj, but I wouldn't let the scrollbar float on the right.
Can you not place it within the content of center.htm ?
- place "scrollable=yes" in here: <frame src="center.htm" name="centerframe" frameborder="no" marginwidth="776">
- place in every page that can appear there the following between the head and the body (adapt colors):

<style type="text/css">
<!--

body
{
scrollbar-face-color:#eeeeee;
scrollbar-arrow-color:white;
scrollbar-track-color:white;
scrollbar-shadow-color:white;
scrollbar-highlight-color:white;
scrollbar-3dlight-color:white;
scrollbar-darkshadow-Color:white;
background-attachment: fixed;
}

-->
</style>
It will look much better !

chechu
02-14-2007, 02:00 PM
Shotgun Ninja,
Follow thetestingsite's advice:

I would suggest (if you want to use a form that is) using a server side language along with your form. If you look around the PHP forums, there are tons floating around. Make sure you can run server side scripts with your host, or else this will not work. Otherwise, use the above posted code (the mailto link).

djr33
02-14-2007, 06:26 PM
Indeed. Server side language is best. It's a bit of work to learn, but very worth it.

And the above code for scrollbars is IE-only, so don't rely too heavily on that,

newj
02-15-2007, 11:39 AM
well how to use the server side? have u seen the zip files that i sent? now how to make that enquiry.htm work??? i used simple javasript
<FORM name=mobicon onsubmit="return validateForm();" action="mailto:sales@mobiconcommodities.com?sub=from website" target="centerframe" method=post>

but it alerts the user that his/her email wud be passed on and all and starts with the wizard.

First one which i used was:

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<link href="style.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
a:link {
color: #93A81C;
}
-->
</style>
</head>

<body>
<table width="776" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td width="227" align="left" valign="top" bgcolor="#EAEAEA"><table width="227" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="images/trans_bar.gif" width="1" height="30"></td>
</tr>
</table></td>
<td bgcolor="#FFFFFF">&nbsp;</td>
<td bgcolor="#FFFFFF">&nbsp;</td>
</tr>
<tr>
<td width="227" rowspan="2" align="left" valign="top" bgcolor="#EAEAEA"><table width="201" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="9" rowspan="4"><img src="images/trans_bar.gif" width="9" height="1"></td>
<td width="9" height="47" align="right" valign="top"><img src="images/greyborder_toplft.gif" width="9" height="47"></td>
<td width="217" height="47" align="left" valign="top" background="images/bkggreyprod.gif"><img src="images/our-prod_caption.gif" width="193" height="47"></td>
<td width="9" height="47" align="left" valign="top"><img src="images/greyborder_toprht.gif" width="9" height="47"></td>
</tr>
<tr>
<td width="9" rowspan="2" background="images/greyborder_lft.gif">&nbsp;</td>
<td width="217" height="178" align="center" valign="top" bgcolor="#FFFFFF"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="185" height="147">
<param name="movie" value="images/left_pics.swf">
<param name="quality" value="high">
<param name="menu" value="false">
<param name="wmode" value="transparent">
<embed src="images/left_pics.swf" width="185" height="147" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" menu="false" wmode="transparent"></embed>
</object></td>
<td width="9" rowspan="2" background="images/greyborder_rht.gif">&nbsp;</td>
</tr>
<tr>
<td bgcolor="#FFFFFF" width="217"><p><img src="images/anyenquiry_txt.gif" width="193" height="37"></p>
<div align="left" style="margin-left:15px; margin-right:px">
<p class="style1"><a href="mailto:sales@mobiconcommodities.com" target="_blank" class="link_text">sales@mobiconcommodities.com</a></p>
<div align="left" style="margin-down:15px; margin-right:px"> </div>
</div></td>
</tr>
<tr>
<td width="9" height="9" align="left" valign="top"><img src="images/greyborder_btomlft.gif" width="9" height="9"></td>
<td height="9" background="images/greyborder_btom.gif" width="217"><img src="images/trans_bar.gif" width="1" height="9"></td>
<td width="9" height="9" align="right" valign="top"><img src="images/greyborder_btomrht.gif" width="9" height="9"></td>
</tr>
</table></td>
<td width="5" rowspan="2" align="left" valign="top" bgcolor="#FFFFFF"><img src="images/trans_bar.gif" width="5" height="1"></td>
</tr>
<tr>
<td align="left" valign="top" bgcolor="#FFFFFF"><table width="530" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="10" rowspan="4"></td>
<td height="16" align="right" valign="top"><img src="images/enquiry_txt.gif" width="80" height="16" align="top"></td>
<td width="10" rowspan="4"><img src="images/trans_bar.gif" width="10" height="1"></td>
</tr>
<tr>
<td width="1" valign="top" bgcolor="#5C97D1"><img src="images/trans_bar.gif" width="1" height="1"></td>
</tr>
<tr>
<td height="7" align="left" valign="top"><img src="images/blue_dot.gif" width="5" height="7"></td>
</tr>
<tr>
<td valign="top"><div align="justify">
<p class="m_text"><br>
As a specialist trading company we offer Sugar, Urea and Containerise HMS 1 &amp; 2. These commodities are sourced directly from manufacturers and mandates and can be supplied at any quantity and to any location.</p>
<p class="m_text">Please email us with your requirements mentioning the following details:</p>
<table width="100%" border="0" cellspacing="2" cellpadding="5">
<tr>
<td valign="top">
<SCRIPT>
String.prototype.trim = function()
{
// skip leading and trailing whitespace
// and return everything in between
return this.replace(/(^\s *)|(\s*$)/g,"")
}

function validateEmail(obj)
{
//Validates email
var tempEmail = obj.value.trim();
var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
if (filter.test(tempEmail))
{
return true;
}
else
{
alert("Incorrect email address");
obj.focus();
return false;
}
}


function validateForm()
{
//Email validation
if(document.mobicon.txtEmail.value.trim() == '')
{
alert("Email Id is required");
document.mobicon.txtEmail.focus();
return false;
}
if(!validateEmail(document.mobicon.txtEmail))
{
return false;
}

//Name validation
if(document.mobicon.txtName.value.trim() == '')
{
alert("Name is required");
document.mobicon.txtName.focus();
return false;
}
return true;
}
</SCRIPT>
<FORM name="mobicon" onsubmit="return validateForm();" action="co.php" target="centerframe" method="post">
<p> <span class="m2_text">YourName*:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>
<input name="txtName" type="text" id="txtName" size="30" maxlength="100">
</p>
<p> <span class="m2_text">Organisation:</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input name="txtOrg" type="text" id="txtOrg" size="30" maxlength="100">
</p>
<p><span class="m2_text">Address:</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input name="textAdd" type="text" id="textAdd" value="" size="30">
</p>
<p><span class="m2_text">email ID*:</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input name="txtEmail" type="text" id="txtEmail" size="30" maxlength="100">
</p>
<p><span class="m2_text">Commodities:</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<textarea name="textcommodities" cols="22" rows="4" id="textcommodities"></textarea>
</p>
<p><span class="m2_text">Quantity:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
<input name="texquantity" type="text" id="texquantity" size="30" maxlength="150">
</p>
<p><span class="m2_text">Destination:</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input name="textdestination" type="text" id="textdestination" size="30" maxlength="100">
</p>
<p><span class="m2_text">Timeframe:</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input name="texttimeframe" type="text" id="texttimeframe" size="30" maxlength="100">
</p>
<p><span class="m2_text">Payment Methood:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input name="textpayment" type="text" id="textpayment" size="30" maxlength="100">
<br>
(DLC / SBLC / BG / <br>
TT/ DAP)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span> </p>
<p><span class="m2_text">Comments:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
<textarea name="txtcomments" cols="23" rows="4" id="txtcomments"></textarea>
</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<INPUT name="email" type=submit id="email" value="E-mail">
</p>
</form></td>
</tr>
</table>
<p></p>
</div></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>

chechu
02-15-2007, 11:45 AM
Stop whatever you have, go to the top of this page, fill in "mail form php" in the searchbox, and enjoy reading the threads.
You will find examples, codes, remarks, etc.
Start from scratch.

newj
02-15-2007, 11:49 AM
hi,
can u help me with the use of server side master!

chechu
02-15-2007, 11:50 AM
Stop whatever you have, go to the top of this page, fill in "mail form php" in the searchbox, and enjoy reading the threads.
You will find examples, codes, remarks, etc.
Start from scratch.
Do the effort ...

newj
02-17-2007, 10:30 AM
thanks for compliment on the site chechu. ur code can only change the color of the scrollbar but it will not bring it to the centreframe. I had already tried that. :)

chechu
02-17-2007, 11:05 AM
I cannot find your site back. Please place a link.

newj
02-17-2007, 12:30 PM
I cannot find your site back. Please place a link.

Hi chechu,
scrollbar is not the worrying issue for me.I am only stuck up with the enquiry form using asp. I have again posted my query in HTML heading.. submission form with the entire code.

I am just hoping to find someone to help me in this... thats it...

Masterskinnie
02-20-2007, 05:09 PM
Thanks Masterskinnie! I use dreamweaver entirely while doing a site. Is something wrong with my form? can i use PHP in this? how? can u help me in this.
BTW, I havent got ur email.

You can use php. Anything thetestingsite says is probably more wise than mine. I would use javascript. and my main e-mail is: masterskinnie@yahoo.com

Email me if you want to accept my offer. it's free.

You could also go to htmlgoodies.com (http://www.htmlgoodies.com) to learn javascript, php, asp, etc.