I have a asp form that someone would complete and when submitted, email is sent with all answers to the questions. If you look at the wizard_proc.asp, there is already html formatted message that is being send back once the user completes the form. What I need is the html formatted message that would be formatted the same way like the form user completes.
this is the form user completes:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml"
xmlns:v="urn:schemas-micro
soft-com:v
ml" xmlns:o="urn:schemas-micro
soft-com:o
ffice:offi
ce">
<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: x-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: #0099CC;
}
.newStyle2 {
color: #D9ECFF;
background-color: #FFFFFF;
}
.style4 {
font-size: small;
font-family: Verdana, Arial, Helvetica, sans-serif;
}
.newStyle1Copy {
font-family: Verdana;
font-size: 12px;
background-color: #CAE4FF;
}
-->
</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
e,strMsg){
var objFormField = theForm.elements[strFieldN
ame];
strDate = objFormField.value;
if(strDate.length>0){
var dateregex=/^[ ]*[0]?(\d{1,2})\/(\d{1,2})
\/(\d{4,})
[ ]*$/;
var match=strDate.match(datere
gex);
if (match){
var tmpdate=new Date(match[3],parseInt(mat
ch[1],10)-
1,match[2]
);
if (tmpdate.getDate()==parseI
nt(match[2
],10) && tmpdate.getFullYear()==par
seInt(matc
h[3],10) && (tmpdate.getMonth()+1)==pa
rseInt(mat
ch[1],10))
{
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
me,strMsg)
{
var objFormField = theForm.elements[strFieldN
ame];
var strValue = objFormField.value;
var objRegExp = /^\([1-9]\d{2}\)\s?\d{3}\-
\d{4}$/;
if(!objRegExp.test(strValu
e)){
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
Name,strMs
g) {
var objFormField = theForm.elements[strFieldN
ame];
var strValue = objFormField.value;
var objRegExp = /(^\d{5}$)|(^\d{5}-\d{4}$)
/;
if(!objRegExp.test(strValu
e)){
strAlertMsg += "- "+ strMsg +" is Required.\n";
if(!focusField) focusField =""+ strFieldName +"";
return false;
}
return true;
}
//========================
==========
==========
==========
==========
==========
//Validate the Select
function hasSelection(theForm,strFi
eldName,st
rMsg) {
var objFormField = theForm.elements[strFieldN
ame];
if(objFormField.selectedIn
dex ==0) {
strAlertMsg += "- "+ strMsg +" is Required.\n";
return false;
}
return true;
}
//========================
==========
==========
==========
==========
========
//Validate Check Box
function isChecked(theForm,strField
Name,strMs
g) {
var objFormField= theForm.elements[strFieldN
ame];
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
me,strMsg)
{
var objFormField = theForm.elements[strFieldN
ame];
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
me,strMsg)
{
var objFormField = theForm.elements[strFieldN
ame]
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,
strFieldNa
me,strMsg)
{
var objFormField = theForm.elements[strFieldN
ame]
intControlLength = objFormField.length
bolSelected = false;
for (i=0;i<intControlLength;i+
+){
if(objFormField[i].checked
){
objFormField[0].style.back
groundColo
r = "white";
bolSelected = true;
break;
}
}
if(! bolSelected){
if(!focusField) focusField =""+ objFormField[0].id +"";
strAlertMsg += "- "+ strMsg +" is Required.\n";
objFormField[0].style.back
groundColo
r = "yellow";
return false;
}
return true;
}
//========================
==========
==========
==========
==========
========
//Compare the Fields
function compareFields(theForm,strF
ieldName1,
strFieldNa
me2,strMsg
){
var objFormField1= theForm.elements[strFieldN
ame1];
var objFormField2= theForm.elements[strFieldN
ame2];
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
matPhone(t
his);
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_
Name','Nam
e')
isEmpty(theForm,'email','E
mail')
isEmpty(theForm,'dDate','D
ate')
checkRadioControl(theForm,
'radio1','
Radio')
checkRadioControl(theForm,
'radio2','
Radio')
isEmpty(theForm,'PhoneB','
textbox')
checkRadioControl(theForm,
'radio3','
Radio')
checkRadioControl(theForm,
'radio4','
Radio')
checkRadioControl(theForm,
'radio5','
Radio')
checkRadioControl(theForm,
'radio6','
Radio')
checkRadioControl(theForm,
'radio7','
Radio')
checkRadioControl(theForm,
'radio8','
Radio')
checkRadioControl(theForm,
'radio9','
Radio')
if(strAlertMsg !=""){
alert("Please correct the following errors:\n_________________
__________
_\n\n" + strAlertMsg);
eval("theForm." + focusField + ".focus()");
//alert(focusField);
theForm[focusField].focus(
);
return false;
}
return true;
}
//-->
</script>
</head>
<body class="sub">
<form id="form1" action="/508/wizard_proc.a
sp" method="post" onsubmit="return validateForm(this);">
<table border="0" cellspacing="2" cellpadding="4" style="width: 800">
<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" class="newStyle1"> </td>
</tr>
</table>
</td>
</tr>
<tr style="vertical-align: top">
<td valign="top" nowrap="nowrap" style="width: 722px">
<p class="style2">
<span class="style2">
<label id="lblCustome_Name" for="Customer_Name" class="style2">Name</label
></span>&n
bsp;
&nbs
p; &n
bsp;
&nbs
p; &n
bsp;
&nbs
p; &n
bsp;
&nbs
p; &n
bsp;
&nbs
p; &n
bsp;
&nbs
p; &n
bsp;
&nbs
p; &n
bsp;
<input type="text" id="Customer_Name" name="Customer_Name" class="newStyle1Copy" tabindex="0" />
<br />
<br />
<label id="lblemail" for="email" class="style2">Please enter your email address</label>  
;
<input type="text" name="email" id="email" class="newStyle1Copy" tabindex="0" />
<br />
<br />
<label id="lbldDate" for="dDate" class="style2">Please enter today's date</label> &n
bsp;
&nbs
p; &n
bsp;
<input type="text" name="dDate" id="dDate" class="newStyle1Copy" tabindex="0" /><br />
<FIELDSET class="style2">
<LEGEND class="style2"> Do you need a screen reader to
access your computer?</LEGEND>
<input type="radio" name="radio1" value="Yes" id="radio1y" class="style2" tabindex="0" /><span class="style2">Yes
</span>
<label><input type="radio" name="radio1" value="No" id="radio1n" class="style2" /><span class="style2">No</span></
label>
</FIELDSET><span class="style2"> </span>
<p class="style2">
<FIELDSET style="height: 38px">
<legend class="style2">Do you need to hear your screen reader
while on the phone?</legend>
<input type="radio" name="radio2" value="Yes" id="radio2y" class="style2" tabindex="0" /><span class="style2">Yes
</span>
<input type="radio" name="radio2" value="No" id="radio2n" class="style2" /><span class="style2">No
</span>
<br /></FIELDSET><span class="style2"><br />
</span>
<FIELDSET>
<legend class="style2">What brand and model of phone do you
use?</legend>
<textarea name="PhoneB" id="PhoneB" rows="5" class="newStyle1Copy" style="width: 373px" tabindex="0"></textarea>
</FIELDSET>
<p class="style2">
<span class="style3">
<FIELDSET class="style2">
<legend>Do you need a braille display for reading information on your
computer?</legend>
<input type="radio" name="radio3" value="Yes" id="radio3y" tabindex="0" />Yes
<input type="radio" name="radio3" value="No" id="radio3n" tabindex="0" />No
</FIELDSET>
</span></p>
<p class="style4">
<FIELDSET>
<legend class="style2">Do you prefer a 40 or 80 cell braille display?</legend>
<input type="radio" name="radio4" value="40 cell" id="radio4y" class="style2" tabindex="0" /><span class="style2">40 cell
</span>
<input type="radio" name="radio4" value="80 cell" id="radio4n" class="style2" tabindex="0" /><span class="style2">80 cell</span></label><span class="style2">
</span>
</FIELDSET>
</p>
<fieldset>
<span class="style3">
<legend class="style2">Do you need to access printed materials to complete your daily
assignments?</legend>
<label id="lblFname" for="radio5">
<input type="radio" name="radio5" value="Yes" id="radio5y" class="style2" /></label></span><label id="Label1" for="radio5"><span class="style2">Yes</span><
/label><sp
an class="style3">
<label>
<input name="radio5" type="radio" id="radio5n" value="No" class="style2" /></label></span><label><s
pan class="style2">No</span></
label><spa
n class="style3">
</span></fieldset>
<p class="style2"><span class="style3">
<fieldset class="style2">
<legend>Do you need to produce hardcopy braille materials in your daily
work activities?</legend>
<label id="Label2" 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></fieldset>
</span></p>
<p class="style2"><span class="style3">
<fieldset class="style2">
<legend>Do you have access to a shared braille embosser (printer)?</legend>
<label id="Label3" for="radio7"><input type="radio" name="radio7" value="Yes" id="radio7y" />Yes
<input type="radio" name="radio7" value="No" id="radio7n" />No</fieldset>
</span></p>
<p class="style2"><span class="style3">
<fieldset class="style2">
<legend>Do you have issues locating keys on your keyboard?</legend>
<label id="Label4" for="radio8"><input type="radio" name="radio8" value="Yes" id="radio8y" />Yes</label>
<input type="radio" name="radio8" value="No" id="radio8n" />No</fieldset>
</span></p>
<p class="StoryContentColor style2 style3"><span class="style2">
<fieldset class="style2">
<legend>Do you need to take notes during meetings away from your desk
and/or in training sessions?</legend>
<input type="radio" name="radio9" value="Yes" id="radio9y" />Yes
<input type="radio" name="radio9" value="No" id="radio9n" />No</fieldset>
</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>
Start Free Trial