Click to See Complete Forum and Search --> : non asp programmer needs help


sarb
09-26-2007, 05:16 PM
Hi,

I did a website for a friend that has a link to an appointment form which is an ASP file. I did not create the form, a friend who is familiar with asp did. I have no real knowledge of ASP.

The appointment.asp form is here:

http://www.naturalwavesprogram.com/appointment.asp

I have been asked to do the following, but as I don't work with programming, really don't know what he is asking for. I'm unable to reach the person who helped me with the programming, so wondered if there's someone who understands what this request means:

"Add a field in the appointment request form. This will be an eight character non-required alphanumeric entry for a promotional code. Add it before the comments box.

Code: [ ]"


Does this make sense to any of you programmers and if so, what exactly do I do with it.

Your help is appreciated.

Thanks,
Sarb

vanny
09-26-2007, 06:01 PM
You will need to attach or insert the code.

ASP is a server side technology, that does processing that we (clients) cannot see, so looking at the source will only give us a limited view of what is happening.

To make changes to a system, you first need to understand the basics of the client and server architecture (eg what is processed and who process it).

If you can put the source to appointment.asp file here someone might be able to point you in the right direction.

Good Luck.

sarb
09-26-2007, 07:58 PM
Thanks vanny, I should have done that to begin with. Here is the code from the asp page:






<%@ Language=VBScript %>
<%
dim strMessage
function monthCombo()
dim strCmb
dim i
strCmb="<select id=""cmbMonth"" name=""cmbMonth"" onchange=""addDays();""><option value=0>Month</option>"
for i=1 to 12
strCmb = strCmb & "<option value=""" & i & """>" & MonthName(i) & "</option>"
next
strCmb=strCmb & "</select>"
Response.Write strCmb
end function
%>
<%
function dayCombo()
dim strCmb
strCmb="<select id=""cmbDay"" name=""cmbDay""><option value=0>Days</option>"
strCmb=strCmb & "</select>"
Response.Write strCmb
end function
%>
<%
function timeCombo()
%>
<select id="cmbTime" name="cmbTime" >
<option value="0">Time</option>
<option value="7:30 AM">7:30 AM</option>
<option value="8:00 AM">8:00 AM</option>
<option value="8:30 AM">8:30 AM</option>
<option value="9:00 AM">9:00 AM</option>
<option value="9:30 AM">9:30 AM</option>
<option value="10:00 AM">10:00 AM</option>
<option value="10:30 AM">10:30 AM</option>
<option value="11:00 AM">11:00 AM</option>
<option value="11:30 AM">11:30 AM</option>
<option value="12:00 PM">12:00 PM</option>
<option value="12:30 PM">12:30 PM</option>
<option value="1:00 PM">1:00 PM</option>
<option value="1:30 PM">1:30 PM</option>
<option value="2:00 PM">2:00 PM</option>
<option value="2:30 PM">2:30 PM</option>
<option value="3:00 PM">3:00 PM</option>
<option value="3:30 PM">3:30 PM</option>
<option value="4:00 PM">4:00 PM</option>
<option value="4:30 PM">4:30 PM</option>
<option value="5:00 PM">5:00 PM</option>
<option value="5:30 PM">5:30 PM</option>
<option value="6:00 PM">6:00 PM</option>
<option value="6:30 PM">6:30 PM</option>
<option value="7:00 PM">7:00 PM</option>
<option value="7:30 PM">7:30 PM</option>
<option value="8:00 PM">8:00 PM</option>
</select>
<%
end function
%>

<%
if Request.Form("txtName") <> "" then
'
dim objMailer
dim sendTo
dim strResponse
strResponse = "Name: " & Request.form("txtName") & "<br>"
strResponse= strResponse & "Sex: " & Request.form("radSex") & "<br>"
strResponse=strResponse & "Age: " & Request.form("txtAge") & "<br>"
strResponse=strResponse & "Clinic: " & Request.form("radClinic") & "<br>"

if Request.Form("chkWeightLoss") <> "" then
strResponse=strResponse & "Weight Loss: Yes"& "<br>"
else
strResponse=strResponse & "Weight Loss: Not selected"& "<br>"
end if

if Request.Form("chkHormoneBalancing") <> "" then
strResponse=strResponse & "Hormone Balancing: Yes"& "<br>"
else
strResponse=strResponse & "Hormone Balancing: Not selected"& "<br>"
end if

if Request.Form("chkSleepImprovement") <> "" then
strResponse=strResponse & "Sleep Improvement: Yes"& "<br>"
else
strResponse=strResponse & "Sleep Improvement: Not selected"& "<br>"
end if

if Request.Form("chkADD_ADHD") <> "" then
strResponse=strResponse & "ADD & ADHD: Yes"& "<br>"
else
strResponse=strResponse & "ADD & ADHD: Not selected"& "<br>"
end if

if Request.Form("chkOHR") <> "" then
strResponse=strResponse & "Overall Health Restoration: Yes"& "<br>"
else
strResponse=strResponse & "Overall Health Restoration: Not selected"& "<br>"
end if

strResponse=strResponse & "Phone: " & Request.form("txtPhone") & "<br>"
strResponse=strResponse & "Email: " & Request.form("txtEmail") & "<br>"

if Request.form("cmbMonth") <> "" and Request.form("cmbMonth") <> "0" then
tMonthName=MonthName(Request.form("cmbMonth"))
else
tMonthName="-"
end if

strResponse=strResponse & "Requested appointment: " & tMonthName & ", " & Request.form("cmbDay") & " " & Request.form("cmbTime") & "<br>"

strResponse=strResponse & "Comments: " & Request.form("txtComments") & "<br>"

if Request.Form("radClinic") = "Bryan" then
sendTo="drbailey@naturalwavesprogram.com"
else
sendTo="drbailey@naturalwavesprogram.com"
end if

Set objMailer = Server.CreateObject("SMTPsvg.Mailer")

fromEmail="inquiry@naturalwavesprogram.com"

objMailer.FromName = fromEmail
objMailer.FromAddress= fromEmail
objMailer.RemoteHost = "localhost"
objMailer.Subject = "Natural Waves Appointment Request"
objMailer.AddRecipient sendTo, sendTo
objMailer.ContentType = "text/html"

objMailer.BodyText = strResponse
if objMailer.SendMail then
strMessage="Your Appointment Request has been successfully submitted. We will get back to you soon. Thanks."
else
strMessage="Message could not be sent, pls. try again later."
end if
end if
%>
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Appointment Request</title>
<link rel="stylesheet" type="text/css" href="fax.css">
<script language="javascript" src="validations.js">
</script>
<script language="javascript" type="text/javascript">
function addDays() {
var objDays,objMonth;
var i;
var monthDays = new Array(0,31,29,31,30,31,30,31,31,30,31,30,31);

objDay=document.getElementById("cmbDay");
objMonth=document.getElementById("cmbMonth");

for (i = objDay.length -1; i >= 1; i--) {
objDay.options[i] = null;
}

for(i=1;i<=monthDays[objMonth.value];i++) {
objDay.options[objDay.length] = new Option(i, i);
}
}
function validate() {
if(checkStrLen(document.frmAppointment.txtName,1,50,"Name")==false)
{
return false;
}
if(!document.frmAppointment.radSex[0].checked && !document.frmAppointment.radSex[1].checked) {
alert("Please Select Sex");
document.frmAppointment.radSex[0].focus();
return false;
}
if(checkFloat(document.frmAppointment.txtAge,1,150,"Age")==false)
{
return false;
}
if(checkStrLen(document.frmAppointment.txtPhone,1,50,"Phone No")==false)
{
return false;
}
if(!checkEmail(document.frmAppointment.txtEmail)) {
alert("Please Enter Valid Value in the Following Field: Email");
document.frmAppointment.focus();
return false;
}
return true;
}
</script>
<style type="text/css">
<!--
.style1 {
color: #FF0000;
font-size: 16px;
font-family: "Times New Roman", Times, serif;
font-style: normal;
font-weight: normal;
}
.style4 {
font-family: Arial, Helvetica, sans-serif;
font-size: 16px;
color: #FF0000;
}
-->
</style>
</head>
<body>
<% if strMessage <> "" then
%>
<br /><br /><div align="center" style="height:200px; vertical-align:middle;"><span style="font-weight: bold;"><% Response.Write(strMessage) %></span><br /><br /><a href="#" class="style4" onClick="javascript:window.history.go(-2);" >Back</a></div>
<%
Response.End()
end if
%>
<form name="frmAppointment" method="post" action="appointment.asp" onSubmit="return validate();">
<h1>Natural Waves Program Appointment Request</h1>
<div>
&nbsp;<span id="Label3"><em>(Fields marked with * are mandatory.)</em></span>
</div>
<br />
<div>
<div>
&nbsp;<span id="Label3" style="font-weight: bold;">Name:</span><span class="style1">*</span></div>
<div>
<input name="txtName" id="txtName" style="width: 374px;" type="text">
</div>
<br>
<div>
&nbsp;<span id="Label3" style="font-weight: bold;">Sex:</span><span class="style1">*</span></div>
<div>
<input name="radSex" type="radio" value="Male" align="absmiddle" /> Male<input name="radSex" type="radio" value="Female" align="absmiddle" /> Female
</div>
<br />
<div>
&nbsp;<span id="Label3" style="font-weight: bold;">Age:</span><span class="style1">*</span></div>
<div>
<input name="txtAge" id="txtAge" style="width: 50px;" type="text"> Years
</div>
<br />
<div>
&nbsp;<span id="Label3" style="font-weight: bold;">Select Your Interest: </span>
</div>
<div>
<input name="chkWeightLoss" type="checkbox" value="Yes" />Weight Loss<br />
<input name="chkHormoneBalancing" type="checkbox" value="Yes" />Hormone Balancing<br />
<input name="chkSleepImprovement" type="checkbox" value="Yes" />Sleep Improvement<br />
<input name="chkADD_ADHD" type="checkbox" value="Yes" />ADD/ADHD<br />
<input name="chkOHR" type="checkbox" value="Yes" />Overall Health Restoration<br />
</div>
<br />
<div>
<span id="Label4" style="font-weight: bold;">Daytime Telephone Number:</span><span class="style1">*</span></div>
<div>
<input name="txtPhone" id="txtPhone" style="width: 374px;" type="text">
</div>
<br />
<div>
<span id="Label4" style="font-weight: bold;">Email Address:</span><span class="style1">*</span></div>
<div>
<input name="txtEmail" id="txtEmail" style="width: 374px;" type="text">
</div>
<br />
<div>
<span id="Label4" style="font-weight: bold;">Select Preferred Appointment Date and Time:</span>
</div>
<div>
<% monthCombo() %> &nbsp;&nbsp;&nbsp;<% dayCombo() %>&nbsp;&nbsp;&nbsp;<% timeCombo() %>
</div>
<br />
<div>
&nbsp;<span id="Label3" style="font-weight: bold;">Clinic: </span>
</div>
<div>
<input name="radClinic" type="radio" value="Bryan" align="absmiddle" checked="checked" /> Bryan Clinic<input name="radClinic" type="radio" value="Houston" align="absmiddle" /> Houston Clinic
</div>
<br />
<div>
<span id="Label4" style="font-weight: bold;">Comments:</span>
</div>
<div>
<textarea id="txtComments" name="txtComments" style="padding: 0px; width: 400px; height: 100px;"></textarea>
</div>
<br />
<div>
<input name="btnSend" value="Send" type="submit">&nbsp;&nbsp;<input name="btnBack" value="Back" onclick="javascript:window.history.back();" type="button">
</div>
</form>
</body>
</html>

Chikara
09-27-2007, 08:14 AM
What do you want to have happen if a promotional code is entered?

sarb
09-27-2007, 02:11 PM
This is for a direct mail piece that will carry a promotional code. The person goes to the website, clicks the request an appointment button, and fills in the information. There will be a field for Code, which they enter, much the same a comments section. It gets reported along with the other info on the form via email. There is no action required from the website other than reporting the code via email. This is to track which media drives the to the website.

Sarb