主题:  关于自动提交的问请高手帮忙解决。

xiongch

职务:普通成员
等级:1
金币:0.0
发贴:2
#12005/9/29 17:52:05
前些日子帮朋友做了一个静态网页,现在朋友要加一个自动提交表单,让客户填好需要的资料后点击提交就自动发送到邮箱中,可是我做了很久都不可以,如将下例码中action=MoreInfoProcess.asp method=post改为action="Mialto:cexodw@126.com时.将弹一个信息框提示,该表单以电子邮件形式提交等<如图>,如同时如何才能让他弹出信息已发出的提示。请高手帮忙,在下在这先谢了.<代码如下>


<TR>
<TD vAlign=top align=left width="100%">
<SCRIPT language=javascript>
<!--
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[i]);
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') {
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 (val<min || max<val) 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> <DIV align=center>
<H1>Request Information Page</H1>
Please feel free to leave us with any comments about our products and our site in general. Just fill in the form below,leaving your details and comments/queries.<BR>
Alternatively you can email us at <span class="box"><span class="style9"><a href="mailto:cexodw@126.com">cexodw@126.com</a></span></span>
<FORM
onsubmit="MM_validateForm('Name','','R','Email','','RisEmail','Company','','R','State','','R','Country','','R');return document.MM_returnvalue"
action=MoreInfoProcess.asp method=post>
<TABLE cellSpacing=1 cellPadding=1 width=470 border=0>
<TBODY>
<TR>
<TD>Name <FONT color=#ff0000>*</FONT>:</TD>
<TD><INPUT style="BACKGROUND-COLOR: #ffffcc" maxLength=256
size=50 name=Name>
</TD>
</TR>
<TR>
<TD>Email <FONT color=#ff0000>*</FONT>:</TD>
<TD><INPUT style="BACKGROUND-COLOR: #ffffcc" maxLength=256
size=50 name=Email>
</TD>
</TR>
<TR>
<TD>Company <FONT color=#ff0000>*</FONT>:</TD>
<TD><INPUT style="BACKGROUND-COLOR: #ffffcc" maxLength=256
size=50 name=Company>
</TD>
</TR>
<TR>
<TD>State <FONT color=#ff0000>*</FONT>:</TD>
<TD><INPUT style="BACKGROUND-COLOR: #ffffcc" maxLength=10
size=5 name=State>
City:
<INPUT maxLength=256 size=14
name=City>
</TD>
</TR>
<TR>
<TD>Country <FONT color=#ff0000>*</FONT>:</TD>
<TD><INPUT style="BACKGROUND-COLOR: #ffffcc" maxLength=256
size=50 name=Country>
</TD>
</TR>
<TR>
<TD>Web:</TD>
<TD><INPUT maxLength=256 size=50 name=Web>
</TD>
</TR>
<TR>
<TD>Fax No:</TD>
<TD><INPUT maxLength=256 size=25 name=Fax>
Handy if we have Email problems.</TD>
</TR>
<TR>
<TD colSpan=2>
<DIV align=center>This information is not passed on to other parties. </DIV></TD>
</TR>
<TR>
<TD colSpan=2>
<P><BR>
Enquiry: <BR>
<TEXTAREA name=Enquiry rows=4 cols=70></TEXTAREA>
</P></TD>
</TR>
<TR>
<TD colSpan=2>Please also send me information about the following Products:
<TEXTAREA name=Enquiry2 rows=4 cols=70></TEXTAREA>
</TD>
</TR>
<TR>
<TD colSpan=2>Comments: <BR>
<TEXTAREA name=Comments rows=3 cols=70></TEXTAREA>
</TD>
</TR>
<TR>
<TD align=middle colSpan=2><INPUT id=submit type=submit value=Submit name=submit>
(<FONT color=#ff0000>*</FONT> <img src="requiredfields.gif" width="33" height="24" align="bottom">Required fields)</TD>
</TR>
</TBODY>
</TABLE>
</FORM>
Email: <span class="box"><span class="style3"><a href="mailto:wanjiacom@mail.wzptt.zj.cn" class="style9">cexodw@126.com</a></span></span></DIV></TD>
</TR>
图片如下:

编辑历史:[此帖最近一次被 xiongch 编辑过(编辑时间:2005-09-29 21:09:40)]