Hi:
I am relatively new to ASP. I prefer Perl, but need to do this form to e-mail sipt for a web page,
See Example of script below that works fine. I want to add the feature to this where it will tell customer that they missed a field, "click
here" to go back & try again.
Does not need to be fancy telling them which field they missed. (Although would be nice) Can even require all fields to be filled out, or do again.
Currently it kicks you out when e-mail field is empty, but not on any other field.
Again..nothing fancy need be written, just the basics.
Any help would be appreciated.
Thanks,
Mark
---------------------------------------------------------------------------------
<%
On Error Resume Next
If Request.Form("s end") <> "" Then
Set iConf = CreateObject ("CDO.Configura tion")
Set Flds = iConf.Fields
Flds(cdoSendUsi ngMethod) = cdoSendUsingPor t
Flds(cdoSMTPSer ver) = "mail.korax.net "
Flds.Update
Set iMesg = CreateObject("C DO.Message")
Set iMesg.Configura tion = iConf
Err.Clear
iMesg.To = "me@mymail. com"
iMesg.From = Request.Form("E mail")
iMesg.Subject = "Email Form"
str1 = Request.Form("F name")
str2 = Request.Form("L name")
str3 = Request.Form("E mail")
iMesg.TextBody = str1 & " " & str2 & str3
iMesg.Send
If Err.Number = 0 Then
Result = ""
Response.Redire ct "http://mydomain.com/thankyou.htm"
Else
Result = "You didn't enter your E-mail address"
End If
End If
%>
<body bgcolor="#3E71A 8" topmargin="0" leftmargin="0" marginheight="0 " marginwidth="0" >
<!--metadata type="typelib" UUID="CD000000-8B95-11D1-82DB-00C04FB1625D" name="CDO for Windows 2000 Type Library" -->
<form method=post>
<table border="0" cellspacing="0" cellpadding="2" width="581">
<td align="right" valign="middle" class="smain" width="192"><fo nt color="red"><b> *</b></font> Firs t: </td>
<td align="left" valign="middle" class="smain" width="119"><in put type="text" name="FName" size="15" maxlength="20" tabindex="2" ID="Text1"></td>
<td align="left" valign="middle" width="1">  ;</td>
<td align="right" valign="middle" class="smain" width="185"><fo nt color="red"><b> *</b></font> Last : </td>
<td align="left" valign="middle" class="smain" width="185"><in put type="text" name="LName" size="15" maxlength="20" tabindex="3" ID="Text2"></td>
<td align="left" valign="middle" class="smain" width="185"><in put type="text" name="Email" size="15" maxlength="20" tabindex="3" ID="Text3"></td>
</tr>
</table>
</form>
Comment