NOTE: Make sure you update the action attribute of your form as shown on my post
Main Topics
Browse All TopicsI want to submit this form to email (CDOSYS and CDONTS) Could someone tell me how this can be done?
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Set the action attribute of your <form> tag so that it points to the ASP page that will be sending the email. Page not found is a clear indication that you are not sending/submitting the form to the right place.
For the purposes of testing, save my first post as hieloEmail.asp, apply the update I mentioned on my previous post, provide your email info, then load it from your browser. Fill the form and submit.
This is what I have in wizard_email.asp that gets called from form action in wizard.asp. I get "HTTP 500 internal server error now. Am I doing this incorrectly?
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="wizard_proc.asp.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtm
<html xmlns="http://www.w3.org/1
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<%@LANGAUGE="JAVASCRIPT"%>
<%
if("undefined" != String(Request("btnSubmit"
{
var data = "";
data += "\nCustomer Name: " + Request("Customer_Name");
data += "\nEmail: " + Request("email");
data += "\nDate: " + Request("dDate");
data += "\nRadio 1: " + Request("radio1");
data += "\nRadio 2: " + Request("radio2");
data += "\nRadio 3: " + Request("radio3");
data += "\nRadio 4: " + Request("radio4");
data += "\nRadio 5: " + Request("radio5");
data += "\nRadio 6: " + Request("radio6");
data += "\nRadio 7: " + Request("radio7");
data += "\nRadio 8: " + Request("radio8");
data += "\nRadio 9: " + Request("radio9");
var myMail=Server.CreateObject
myMail.Subject="Sending email with CDO";
myMail.From="dar@ssi.com";
myMail.To="dar.z@ssi.com";
myMail.TextBody=data;
myMail.Send();
myMail=null;
Response.Write("Thank You!")
Response.End
}
%>
</body>
</html>
>>action="<%=Request.Serve
This part:
Request.ServerVariables('S
is supposed to give you the name of the executing script. So if you save you file as:
http://www.yourdomain.com/
then it should evaluate to:
/myscripts/test.asp
The <%=%> is an ASP shorthand for Response.Write. So esssentially that line says:
action="Response.Write('/m
If it is giving you problems, then change manually to the name of your script:
action="/myscripts/test.as
Ok, so I did copy and pasted all code into notepad and saved it as wizard.asp. I modified the action and upladed to the server for testing and got "the page cannot be displayed" error. code is below:
<%@LANGAUGE="JAVASCRIPT"%>
<%
if("undefined" != String(Request("btnSubmit"
{
var data = "";
data += "\nCustomer Name: " + Request("Customer_Name");
data += "\nEmail: " + Request("email");
data += "\nDate: " + Request("dDate");
data += "\nRadio 1: " + Request("radio1");
data += "\nRadio 2: " + Request("radio2");
data += "\nPhoneB: " + Request("PhoneB");
data += "\nRadio 3: " + Request("radio3");
data += "\nRadio 4: " + Request("radio4");
data += "\nRadio 5: " + Request("radio5");
data += "\nRadio 6: " + Request("radio6");
data += "\nRadio 7: " + Request("radio7");
data += "\nRadio 8: " + Request("radio8");
data += "\nRadio 9: " + Request("radio9");
var myMail=Server.CreateObject
myMail.Subject="Sending email with CDO";
myMail.From="test@ssi.com"
myMail.To="test1@ssi.com";
myMail.Bcc="someoneelse@so
myMail.Cc="someoneelse2@so
myMail.TextBody=data;
myMail.Send();
myMail=null;
Response.Write("Thank You!")
Response.End
}
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtm
<html xmlns="http://www.w3.org/1
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
<!--
.style2 {
font: 12px;
font-size: small;
font-family: Verdana;
}
.style3 {font-family: Verdana, Arial, Helvetica, sans-serif}
th
{ color: #000000; font-family: Tahoma, Verdana; font-size: 11px; }
.newStyle1 {
font-family: Verdana;
font-size: 12px;
background-color: #CCE6FF;
}
.newStyle2 {
color: #D9ECFF;
background-color: #FFFFFF;
}
-->
</style>
<script type="text/javascript">
<!--
/*************************
Original Script By
Patrick Fairfield (a.k.a fritz_the_blank)
Fairfield Consulting
==========================
Edited by Jay Solomon
jaysolomon *AT* pclnet *DOT* net
**************************
var strAlertMsg = ""
var focusField = ""
//========================
//validate Date
function isDate(theForm,strFieldNam
var objFormField = theForm.elements[strFieldN
strDate = objFormField.value;
if(strDate.length>0){
var dateregex=/^[ ]*[0]?(\d{1,2})\/(\d{1,2})
var match=strDate.match(datere
if (match){
var tmpdate=new Date(match[3],parseInt(mat
if (tmpdate.getDate()==parseI
return true;
}
}
strAlertMsg += "- "+ strMsg +" is Required.\nExample: 01/01/2003\n";
if(!focusField) focusField =""+ strFieldName +"";
return false;
}
else{
return true;
}
}
//========================
//Validate Us Phone. Ex. (999) 999-9999 or (999)999-9999
function isPhone(theForm,strFieldNa
var objFormField = theForm.elements[strFieldN
var strValue = objFormField.value;
var objRegExp = /^\([1-9]\d{2}\)\s?\d{3}\-
if(!objRegExp.test(strValu
strAlertMsg += "- "+ strMsg +" is Required.\n Example:\n(999)999-9999 or (999) 999-9999\n";
if(!focusField) focusField=""+ strFieldName +"";
return false;
}
return true;
}
//========================
//Validate US zip code in 5 digit format or zip+4 format. 99999 or 99999-9999
function isZipCode(theForm,strField
var objFormField = theForm.elements[strFieldN
var strValue = objFormField.value;
var objRegExp = /(^\d{5}$)|(^\d{5}-\d{4}$)
if(!objRegExp.test(strValu
strAlertMsg += "- "+ strMsg +" is Required.\n";
if(!focusField) focusField =""+ strFieldName +"";
return false;
}
return true;
}
//========================
//Validate the Select
function hasSelection(theForm,strFi
var objFormField = theForm.elements[strFieldN
if(objFormField.selectedIn
strAlertMsg += "- "+ strMsg +" is Required.\n";
return false;
}
return true;
}
//========================
//Validate Check Box
function isChecked(theForm,strField
var objFormField= theForm.elements[strFieldN
var strValue= objFormField.checked;
if (!strValue) {
//alert("The \""+ strMsg +"\" box is checked!")
//} else {
strAlertMsg += "- "+ strMsg +" is Required.\n";
if(!focusField) focusField =""+ strFieldName +"";
return false;
}
return true;
}
//========================
//Validate Text Box
function isEmpty(theForm,strFieldNa
var objFormField = theForm.elements[strFieldN
var strValue = objFormField.value;
strValue = strValue.split(" ").join("")
if(strValue.length<1){
strAlertMsg += "- "+ strMsg +" is Required.\n";
if(!focusField) focusField =""+ strFieldName +"";
return false;
}
return true;
}
//========================
//Validate Email
function isEmail(theForm,strFieldNa
var objFormField = theForm.elements[strFieldN
var strEmail = objFormField.value;
var bolValid = true;
if(strEmail.length < 7){
bolValid = false;
}
if(strEmail.lastIndexOf(" ") >0){
bolValid = false;
}
var intLastDot = strEmail.lastIndexOf(".")
if(intLastDot == -1 || strEmail.length - intLastDot >4){
bolValid = false;
}
var intAt = strEmail.lastIndexOf("@")
if(intAt == -1 || strEmail.length - intAt < 5){
bolValid = false;
}
if(!bolValid){
strAlertMsg += "- "+ strMsg +" is Required.\n";
if(!focusField) focusField =""+ strFieldName +"";
}
return bolValid;
}
//========================
//Validate Radio Button
function checkRadioControl(theForm,
var objFormField = theForm.elements[strFieldN
intControlLength = objFormField.length
bolSelected = false;
for (i=0;i<intControlLength;i+
if(objFormField[i].checked
bolSelected = true;
break;
}
}
if(! bolSelected){
if(!focusField) focusField =""+ objFormField[0].id +"";
strAlertMsg += "- "+ strMsg +" is Required.\n";
return false;
}
return true;
}
//========================
//Compare the Fields
function compareFields(theForm,strF
var objFormField1= theForm.elements[strFieldN
var objFormField2= theForm.elements[strFieldN
var strValue1= objFormField1.value;
var strValue2= objFormField2.value;
if(strValue1 != strValue2){
strAlertMsg +="The "+ strMsg +" fields do not match, please try again.\n";
if(!focusField) focusField =""+ strFieldName1 +"";
return false;
}
return true;
}
//========================
//Format Phone Number 9999999999 = (999)999-9999
//Call the function like so onKeyPress="javascript:for
function formatPhone(objFormField){
intFieldLength = objFormField.value.length;
if(intFieldLength == 3){
objFormField.value = "(" + objFormField.value + ") ";
return false;
}
if(intFieldLength >= 9 && intFieldLength <= 10){
objFormField.value = objFormField.value + "-";
return false;
}
}
//========================
//End .js File
//Begin Page Validation
function validateForm(theForm){
strAlertMsg = ""
focusField = ""
isEmpty(theForm,'Customer_
isEmpty(theForm,'email','E
isEmpty(theForm,'dDate','D
checkRadioControl(theForm,
checkRadioControl(theForm,
isEmpty(theForm,'PhoneB','
checkRadioControl(theForm,
checkRadioControl(theForm,
checkRadioControl(theForm,
checkRadioControl(theForm,
checkRadioControl(theForm,
checkRadioControl(theForm,
checkRadioControl(theForm,
if(strAlertMsg !=""){
alert("Please correct the following errors:\n_________________
eval("theForm." + focusField + ".focus()");
//alert(focusField);
theForm[focusField].focus(
return false;
}
return true;
}
//-->
</script>
</head>
<body class="sub">
<form id="form1" action="/508/wizard.asp" method="post" onsubmit="return validateForm(this);">
<table width="90%" border="0" cellspacing="2" cellpadding="4">
<tr style="vertical-align: top">
<td valign="top" nowrap="nowrap" style="width: 722px; height: 31px;">
<table cellSpacing="0" cellPadding="0" align="left" border="0" style="width: 713px">
<tr>
<th style="FONT-SIZE: 12px; COLOR: white" noWrap bgColor="#4682b4">
Visual Impairment Form<img height="1" src="pixel.gif" width="10" border="0" /></th>
<td>
<img height="21" src="formtab_r.gif" width="10" border="0" /></td>
<td width="100%" background="line_t.gif"> </td>
</tr>
</table>
</td>
</tr>
<tr style="vertical-align: top">
<td valign="top" nowrap="nowrap" style="width: 722px">
<p class="style2">
<label id="lblCustome_Name" for="Customer_Name" class="style2">Name</label
<input type="text" id="Customer_Name" name="Customer_Name" class="newStyle1" tabindex="0" />
<label id="lblemail" for="email" class="style2">Please enter your email address</label>
<input type="text" name="email" id="email" class="newStyle1" tabindex="0" />
<label id="lbldDate" for="dDate" class="style2">Please enter today's date</label>
<input type="text" name="dDate" id="dDate" class="newStyle1" tabindex="0" />
<FIELDSET>
<LEGEND> Do you need a screen reader to
access your computer?</LEGEND>
<input type="radio" name="radio1" value="Yes" id="radio1y" class="style2" tabindex="0" />
Yes
<label><input type="radio" name="radio1" value="No" id="radio1n" class="style2" />
No</label>
</FIELDSET>
<p class="style2">
<label id="lblradio2" for="radio2">Do you need to hear your screen reader
while on the phone?</label>
<input type="radio" name="radio2" value="Yes" id="radio2y" class="style2" tabindex="0" />
Yes
<input type="radio" name="radio2" value="No" id="radio2n" class="style2" />
No
<p class="style2">
<label id="lblFname" for="PhoneB">What brand and model of phone do you
use?
</label>
<textarea name="PhoneB" id="PhoneB" rows="5" class="newStyle1" style="width: 373px" tabindex="0"></textarea>
<p class="style2">
<span class="style3">
<label>Do you need a braille display for reading information on your
computer?</label>
<label id="lblFname" for="radio3">
<input type="radio" name="radio3" value="Yes" id="radio3y" class="style2" tabindex="0" />
Yes</label>
<label>
<input type="radio" name="radio3" value="No" id="radio3n" class="style2" tabindex="0" />
No</label>
</span></p>
<p class="style2"><span class="style3">
<label>Do you prefer a 40 or 80 cell braille display?</label>
<label id="lblFname" for="radio4">
<input type="radio" name="radio4" value="40 cell" id="radio4y" class="style2" tabindex="0" />
40 cell</label>
<label>
<input type="radio" name="radio4" value="80 cell" id="radio4n" class="style2" tabindex="0" />
80 cell</label>
</span></p>
<p class="style2"><span class="style3">
<label>Do you need to access printed materials to complete your daily
assignments?</label>
<label id="lblFname" for="radio5"><input type="radio" name="radio5" value="Yes" id="radio5y" />
Yes</label>
<label>
<input name="radio5" type="radio" id="radio5n" value="No" />
No</label>
</span></p>
<p class="style2"><span class="style3">
<label>Do you need to produce hardcopy braille materials in your daily
work activities?</label>
<label id="lblFname" for="radio6"><input type="radio" name="radio6" value="Yes" id="radio6y" />
Yes</label>
<label>
<input type="radio" name="radio6" value="No" id="radio6n" />
No</label>
</span></p>
<p class="style2"><span class="style3">
<label>Do you have access to a shared braille embosser (printer)?</label>
<label id="lblFname" for="radio7"><input type="radio" name="radio7" value="Yes" id="radio7y" />
Yes</label>
<label>
<input type="radio" name="radio7" value="No" id="radio7n" />
No</label>
</span></p>
<p class="style2"><span class="style3">
<label>Do you have issues locating keys on your keyboard?</label>
<label id="lblFname" for="radio8"><input type="radio" name="radio8" value="Yes" id="radio8y" />
Yes</label>
<label>
<input type="radio" name="radio8" value="No" id="radio8n" />
No</label>
</span></p>
<p class="StoryContentColor style2 style3"><span class="style2">
<label>Do you need to take notes during meetings away from your desk
and/or in training sessions?</label>
<label id="lblFname" for="radio9"><input type="radio" name="radio9" value="Yes" id="radio9y" />
Yes</label>
<label>
<input type="radio" name="radio9" value="No" id="radio9n" />
No</label>
</span></p></td>
</tr>
<tr style="vertical-align: top">
<td style="width: 722px">
<input type="submit" id="btnSubmit" name="btnSubmit" value="Submit" />
<input type="reset" id="btnReset" name="btnReset" value="Reset" />
</td>
</tr>
</table>
</form>
</body>
</html>
If you don't set the correct value on action this will not work. For the sake of clarity, let's say that the page you posted above can be accessed from a webrowser by going to http://www.yoursite.com/my
<form action="/myScripts/testEma
If you look closely it is the complete url MINUS the domain (http://www.yoursite.com).
<form action="/508/wizard.asp">
which means that:
1. The code on your last post better be from a file named wizard.asp because what I gave you originally was a self-posting script.
2. you should be able to type this directly into the browser:
http://www.yoursite.com/50
and get the "blank form" the first time you get to the page. When you submit it will send the data to itself (hence self-posting), and when it detects that you actually submitted data to it, it will then proceed to send the email.
Having gotten that out of the way, "the page cannot be displayed" reveals nothing about the nature of the error. An error line or a server-generated error description is more helpful. I can't help you more from what you provided.
Business Accounts
Answer for Membership
by: hieloPosted on 2008-02-12 at 14:24:17ID: 20879846
Fill in the appropriate email info
Select allOpen in new window