...

View Full Version : email script that works but with minor problem



ivanhoe
07-26-2002, 07:58 AM
Hi there all,
I have this script and for too long we have no problems only recently we have this going on!
First, when someone fills everything in the form below and click to submit , on our end as recipient it seems completely blank.
Here is what is going on, say one fills every questions at hand and right after -click to submit
Thereafter an email subpage appears just like when you are sending regular email.
And since one has filled up all posted questioneer prior and living this subpage blank. It is this email subpage that we receive as blank.
Can someone fix this for us?
Like click and it gets through and probably with a thankyou note after submit.
Please help, really need badly

<table>
<FORM NAME="mailform" form ACTION="mailto:support@mydomain?Subject=Comment Product Inquiry" METHOD = "POST" ENCTYPE = "text/plain">
<INPUT TYPE="hidden" SIZE = 0 NAME="Need Info">



<tr>
<td>
</font><b><font face="times" size="3"
color="red">__Your Name:__
<td>
<INPUT TYPE = "text" NAME = "Name">
</font><b>
<BODY OnLoad="document.mailform.Name.focus();">
<font face="times" size="4"
color="red">*<TR>
<td>
Company </font><font face="times" size="3"
color="blue">(optional):
<td>
<INPUT TYPE = "text" NAME = "Company">
<tr>
<td></font><b><font face="Times" size="3"
color="Red">
Product Inquiry:
<td>
<INPUT TYPE = "text" NAME = "Inquiry">
<tR>
<td></font><b><font face="Times" size="3"
color="Red">
E-mail #:
<td>
<INPUT TYPE = "text" NAME = "Email">
<tr>
<td>
</font><b><font face="Times" size="5"
color="Red"> Comments:
<td>
<TEXTAREA NAME="Comments" COLS=50 ROWS=6>
</TEXTAREA>
</table>
<CENTER>
<INPUT TYPE="SUBMIT" NAME="Submit" VALUE="Submit">
<INPUT TYPE = "button" VALUE = "Return to Previous Page" onClick="history.back();">
</CENTER>
</FORM>
</body>
</html>

lavalamp
11-27-2003, 07:08 PM
I know that it's been a while since you posted this, but if you still haven't resolved your problem try this.

lavalamp
12-03-2003, 12:38 PM
Is this the problem line of code?




butt='<scr'+'ipt>function fax(){javascript:print();}</scr'+'ipt><table border="0" width="100%" cellspacing="0" cellpadding="0" align="center"><tr><td width="100%" valign="middle" align="center"><input type="button" value="Print this Form for Faxing" name="FaxDocument" onclick="fax()"><input type="button" value="Submit this Form via Email" name="Email" onclick="javascript:alert(\'DO NOT KNOW HOW TO SOLVE THIS\')"></td></tr></table>';

If it is then here's what it should be:




butt='<scr'+'ipt type="text/javascript">';
butt+='function fax(){javascript:print();}';
butt+='function doalert(){alert("SOLVED (HOPEFULLY)");}';
butt+='</scr'+'ipt>';

butt+='<table border="0" width="100%" cellspacing="0" cellpadding="0" align="center">';
butt+='<tr><td width="100%" valign="middle" align="center">';
butt+='<input type="button" value="Print this Form for Faxing" name="FaxDocument" onclick="fax()">';
butt+='<input type="button" value="Submit this Form via Email" name="Email" onclick="doalert()">';
butt+='</td></tr></table>';

Willy Duitt
12-03-2003, 03:15 PM
Originally posted by ivanhoe
Hi there all,
I have this script and for too long we have no problems only recently we have this going on!

First, when someone fills everything in the form below and click to submit , on our end as recipient it seems completely blank.

Here is what is going on, say one fills every questions at hand and right after -click to submit

Thereafter an email subpage appears just like when you are sending regular email.

And since one has filled up all posted questioneer prior and living this subpage blank. It is this email subpage that we receive as blank.

Can someone fix this for us?
Like click and it gets through and probably with a thankyou note after submit.
Please help, really need badly

I have found that Outlook Express will not
submit the form contents when using mailto:

I've been using a workaround which takes the values of the form
and places those values into a hidden span. The contents of the
span is then submitted with the form.

An example can be found here (http://www.codingforums.com/showthread.php?s=&postid=151656#post151656) and here (http://www.webxpertz.net/forums/showthread.php3?s=&threadid=26956).


.....Willy

lavalamp
12-03-2003, 06:54 PM
Ideally, if you were willing to learn some server side code, you could get the results from the form using the post method and use PHP (or some other server side code) to e-mail the results to you.

Hey Willy, thanks for the new forum for me to mess around in. :D

ivanhoe
12-04-2003, 07:50 AM
Hey lavalamp,
Your email txt file attachment for some reason I could not download or open it.

Willy, yours too! Your two samples won't direct me to it or open it.
But it would be swell if mailto could be open through IE, I can used a side server but I got to see frist what those 2 samples are.

Lavalamp, you are right these is where my problem is
and if I do understand Willy, it will really be beneficial to
open the file through IE and I sure need your help where
or how it would work with all the details if you can.
Say if click submit, and my email sample is http://myemail.com
and just the sample you did below didn't work either much as
with the print section when clicked.

>>>butt='<scr'+'ipt type="text/javascript">';
butt+='function fax(){javascriptrint();}';
butt+='function doalert(){alert("SOLVED (HOPEFULLY)");}';
butt+='</scr'+'ipt>';

butt+='<table border="0" width="100%" cellspacing="0" cellpadding="0" align="center">';
butt+='<tr><td width="100%" valign="middle" align="center">';
butt+='<input type="button" value="Print this Form for Faxing" name="FaxDocument" onclick="fax()">';
butt+='<input type="button" value="Submit this Form via Email" name="Email" onclick="doalert()">';
butt+='</td></tr></table>';


""THANKS""

Willy Duitt
12-04-2003, 12:32 PM
Originally posted by ivanhoe
Willy, yours too! Your two samples won't direct me to it or open it.
But it would be swell if mailto could be open through IE, I can used a side server but I got to see frist what those 2 samples are.

I just checked your demo page (http://www.marksignusa.com/pp---NOT.html) and did not see any changes which included any type of form handling. Please post what you have which shows how you tried to implement passing the form data using hidden spans.

If you are trying to pass the complete Table structure you generate. You better use Server Side form handling. If you try to do this with mailto: what you recieve will not be rendered as HTML but rather as text/plain with all of the tags appearing in the body of your message.

The below script will do exactly that.


<script type="text/javascript">
<!--//
function submitData() {
var me = 'YOU';
var at = '@';
var site = 'YOUR_DOMAIN.com';
var to = me+at+site;
var sub = 'MY ORDER FORM RESULTS';

var paras = document.getElementsByTagName('form');
var msg = "";
for (var i = 0; i < paras.length; i++)
msg += paras[i].innerHTML + '\n';
msg = (escape(msg));
document.forms[0].action="mailto:"+to+"?subject="+sub+"&body="+msg;
document.forms[0].submit();
}
// -->
</script>

Good Luck;
.....Willy



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum