Crash1hd
06-12-2003, 07:30 PM
The Following code works fine in IE and Netscape but I get errors in Opera
<%@Language=VBScript%>
<!--#INCLUDE Virtual="/Include/Header.asp"-->
<html><head><title>New Page 1</title>
<%
'***************************** DIMENSION VARIABLES
' These variables are being dimmed now since they may be used many places.
' Some others, such as database queries, will be dimmed in the
' subroutine in which they are used.
' Connection variables
Dim submitnumber
Dim backcheck
Dim dcheck
Dim FSDoFMonth
Dim FSDoFDay
Dim FSDoFYear
'******************************* REQUEST VARIABLES
Select Case Request.ServerVariables("REQUEST_METHOD")
Case "POST"
submitnumber = Request.Form("submitnumber")
backcheck = Request.Form("backcheck")
dcheck = Request.Form("dcheck")
End Select
'********************** INITIALIZE OTHER VARIABLES
If submitnumber = 0 Then
backcheck = 0
End If
If backcheck = 1 Then
submitnumber = 0
Else
submitnumber = submitnumber + 1
End If
dcheck = dcheck + 1
'************************************ MAIN PROGRAM
Select Case Int(Request.QueryString("dbshow"))
Case 1
ConfirmObit()
Case Else
InputObit()
End Select
'******************************** End MAIN PROGRAM
%>
<%Sub InputObit() '''''''''''''''''''''''''''''''''''%>
<SCRIPT language="JavaScript">
//Unable to put this in JS file as it has ASP in it!
//function to set options to today
<%
FSDoFMonth = Request.Form("DoFMonthField")
FSDoFDay = Request.Form("DoFDayField")
FSDoFYear = Request.Form("DoFYearField")
%>
function SetToToday(Which)
{
<%If dcheck = 1 Then%>
DaysObject = eval("document.Form1." + Which + "Day");
MonthObject = eval("document.Form1." + Which + "Month");
YearObject = eval("document.Form1." + Which + "Year");
YearObject[1].selected = true;
MonthObject[NowMonth].selected = true;
ChangeOptionDays(Which);
DaysObject[NowDay-1].selected = true;
<%End If%>
}
function WriteDoFOptions(DaysAhead)
{
line = "";
for (i=0; i<DaysAhead; i++)
{
<%If dcheck = 1 Then FSDoFDay=0%>
<%If FSDoFDay="" Then FSDoFDay=0%>
if (i==<%=FSDoFDay%>-1) <%if FSDoFDay <> "" Then response.write("line += ""<OPTION Value=" & FSDoFDay & " SELECTED>"";")%>
else <%if FSDoFDay <> "" Then response.write("line += ""<OPTION>"";")%>
if (i==0 || i==1 || i==2 || i==3 || i==4 || i==5 || i==6 || i==7 || i==8) line += "0";
line += (NowDay - NowDay + 1) + i;
line += "</OPTION>";
}
return line;
}
function WriteDoFYearOptions(YearsAhead)
{
line = "";
for (i=0; i<YearsAhead; i++)
{
<%If dcheck = 1 Then FSDoFYear=0%>
<%If FSDoFYear="" Then FSDoFYear=0%>
if (i==(NowYear + 1) -<%=FSDoFYear%>) <%if FSDoFYear <> "" Then response.write("line += ""<OPTION Value=" & FSDoFYear & " SELECTED>"";")%>
else <%if FSDoFYear <> "" Then response.write("line += ""<OPTION>"";")%>
line += (NowYear + 1) - i;
line += "</OPTION>";
}
return line;
}
</SCRIPT>
</head>
<body onload = "SetToToday('FSDoF');">
<FORM name="Form1" action="Drop%20Down%20Calander.asp?dbshow=1" method="post">
<input type="hidden" name="submitnumber" value="<% = submitnumber %>" />
<input type="hidden" name="dcheck" value="<% = dcheck %>" />
<table cellspacing="2" cellpadding="5" border="0" align="center">
<tr>
<td align="right">
<font color="red">* Date of Funeral: </font>
</td>
<td>
<SELECT name="FSDoFMonth" onchange="ChangeOptionDays('FSDoF')">
<option value="01"<%If FSDoFMonth = "01" Then Response.Write("selected")%>>January</option>
<option value="02"<%If FSDoFMonth = "02" Then Response.Write("selected")%>>February</option>
<option value="03"<%If FSDoFMonth = "03" Then Response.Write("selected")%>>March</option>
<option value="04"<%If FSDoFMonth = "04" Then Response.Write("selected")%>>April</option>
<option value="05"<%If FSDoFMonth = "05" Then Response.Write("selected")%>>May</option>
<option value="06"<%If FSDoFMonth = "06" Then Response.Write("selected")%>>June</option>
<option value="07"<%If FSDoFMonth = "07" Then Response.Write("selected")%>>July</option>
<option value="08"<%If FSDoFMonth = "08" Then Response.Write("selected")%>>August</option>
<option value="09"<%If FSDoFMonth = "09" Then Response.Write("selected")%>>September</option>
<option value="10"<%If FSDoFMonth = "10" Then Response.Write("selected")%>>October</option>
<option value="11"<%If FSDoFMonth = "11" Then Response.Write("selected")%>>November</option>
<option value="12"<%If FSDoFMonth = "12" Then Response.Write("selected")%>>December</option>
</SELECT>
<SELECT name="FSDoFDay">
<SCRIPT language="JavaScript">
document.write(WriteDoFOptions(31));
</SCRIPT>
</SELECT>
<SELECT name="FSDoFYear" onchange="ChangeOptionDays('FSDoF')">
<SCRIPT language="JavaScript">
document.write(WriteDoFYearOptions(200));
</SCRIPT>
</SELECT>
</td>
</tr>
<tr>
<td>
<input type="Submit" value="Submit">
</td>
</tr>
</table>
</FORM>
</body>
<%End Sub '''''''''''''''''''''''''''''''''''''''''''%>
<%Sub ConfirmObit() '''''''''''''''''''''''''''''''''''%>
<form name="Form2" action="#" method="post">
<table border="0" width="80%">
<tr>
<td align="right" width="25%">
<font color="red">Date Of Funeral: </font>
</td>
<td>
<%
If Request.Form("FSDoFMonth")<>"" Then
If Request.Form("FSDoFMonth") = "01" Then Response.Write "January"
If Request.Form("FSDoFMonth") = "02" Then Response.Write "February"
If Request.Form("FSDoFMonth") = "03" Then Response.Write "March"
If Request.Form("FSDoFMonth") = "04" Then Response.Write "April"
If Request.Form("FSDoFMonth") = "05" Then Response.Write "May"
If Request.Form("FSDoFMonth") = "06" Then Response.Write "June"
If Request.Form("FSDoFMonth") = "07" Then Response.Write "July"
If Request.Form("FSDoFMonth") = "08" Then Response.Write "Augest"
If Request.Form("FSDoFMonth") = "09" Then Response.Write "September"
If Request.Form("FSDoFMonth") = "10" Then Response.Write "October"
If Request.Form("FSDoFMonth") = "11" Then Response.Write "November"
If Request.Form("FSDoFMonth") = "12" Then Response.Write "December"
Response.Write (" ")
Response.Write Request.Form("FSDoFDay")
Response.Write (", ")
Response.Write Request.Form("FSDoFYear")
End If
%>
</td>
</tr>
<tr>
<td align="center" colspan="2">
<b>If The Information Is Not Correct Please Click The Back Button To Correct Any Mistakes</b><br />
</td>
</tr>
<tr>
<td align="center" colspan="2">
<input type="hidden" name="dcheck" value="<%=dcheck%>">
<input type="hidden" name="FSDoFMonth" value="<%=FSDoFMonth%>">
<input type="hidden" name="FSDoFDay" value="<%=FSDoFDay%>">
<input type="hidden" name="FSDoFYear" value="<%=FSDoFYear%>">
<input type="submit" value="Go Back" onClick="this.form.action='Drop%20Down%20Calander.asp';">
</td>
</tr>
</table>
</form>
<%End Sub '''''''''''''''''''''''''''''''''''''''''''%>
</html>
<%@Language=VBScript%>
<!--#INCLUDE Virtual="/Include/Header.asp"-->
<html><head><title>New Page 1</title>
<%
'***************************** DIMENSION VARIABLES
' These variables are being dimmed now since they may be used many places.
' Some others, such as database queries, will be dimmed in the
' subroutine in which they are used.
' Connection variables
Dim submitnumber
Dim backcheck
Dim dcheck
Dim FSDoFMonth
Dim FSDoFDay
Dim FSDoFYear
'******************************* REQUEST VARIABLES
Select Case Request.ServerVariables("REQUEST_METHOD")
Case "POST"
submitnumber = Request.Form("submitnumber")
backcheck = Request.Form("backcheck")
dcheck = Request.Form("dcheck")
End Select
'********************** INITIALIZE OTHER VARIABLES
If submitnumber = 0 Then
backcheck = 0
End If
If backcheck = 1 Then
submitnumber = 0
Else
submitnumber = submitnumber + 1
End If
dcheck = dcheck + 1
'************************************ MAIN PROGRAM
Select Case Int(Request.QueryString("dbshow"))
Case 1
ConfirmObit()
Case Else
InputObit()
End Select
'******************************** End MAIN PROGRAM
%>
<%Sub InputObit() '''''''''''''''''''''''''''''''''''%>
<SCRIPT language="JavaScript">
//Unable to put this in JS file as it has ASP in it!
//function to set options to today
<%
FSDoFMonth = Request.Form("DoFMonthField")
FSDoFDay = Request.Form("DoFDayField")
FSDoFYear = Request.Form("DoFYearField")
%>
function SetToToday(Which)
{
<%If dcheck = 1 Then%>
DaysObject = eval("document.Form1." + Which + "Day");
MonthObject = eval("document.Form1." + Which + "Month");
YearObject = eval("document.Form1." + Which + "Year");
YearObject[1].selected = true;
MonthObject[NowMonth].selected = true;
ChangeOptionDays(Which);
DaysObject[NowDay-1].selected = true;
<%End If%>
}
function WriteDoFOptions(DaysAhead)
{
line = "";
for (i=0; i<DaysAhead; i++)
{
<%If dcheck = 1 Then FSDoFDay=0%>
<%If FSDoFDay="" Then FSDoFDay=0%>
if (i==<%=FSDoFDay%>-1) <%if FSDoFDay <> "" Then response.write("line += ""<OPTION Value=" & FSDoFDay & " SELECTED>"";")%>
else <%if FSDoFDay <> "" Then response.write("line += ""<OPTION>"";")%>
if (i==0 || i==1 || i==2 || i==3 || i==4 || i==5 || i==6 || i==7 || i==8) line += "0";
line += (NowDay - NowDay + 1) + i;
line += "</OPTION>";
}
return line;
}
function WriteDoFYearOptions(YearsAhead)
{
line = "";
for (i=0; i<YearsAhead; i++)
{
<%If dcheck = 1 Then FSDoFYear=0%>
<%If FSDoFYear="" Then FSDoFYear=0%>
if (i==(NowYear + 1) -<%=FSDoFYear%>) <%if FSDoFYear <> "" Then response.write("line += ""<OPTION Value=" & FSDoFYear & " SELECTED>"";")%>
else <%if FSDoFYear <> "" Then response.write("line += ""<OPTION>"";")%>
line += (NowYear + 1) - i;
line += "</OPTION>";
}
return line;
}
</SCRIPT>
</head>
<body onload = "SetToToday('FSDoF');">
<FORM name="Form1" action="Drop%20Down%20Calander.asp?dbshow=1" method="post">
<input type="hidden" name="submitnumber" value="<% = submitnumber %>" />
<input type="hidden" name="dcheck" value="<% = dcheck %>" />
<table cellspacing="2" cellpadding="5" border="0" align="center">
<tr>
<td align="right">
<font color="red">* Date of Funeral: </font>
</td>
<td>
<SELECT name="FSDoFMonth" onchange="ChangeOptionDays('FSDoF')">
<option value="01"<%If FSDoFMonth = "01" Then Response.Write("selected")%>>January</option>
<option value="02"<%If FSDoFMonth = "02" Then Response.Write("selected")%>>February</option>
<option value="03"<%If FSDoFMonth = "03" Then Response.Write("selected")%>>March</option>
<option value="04"<%If FSDoFMonth = "04" Then Response.Write("selected")%>>April</option>
<option value="05"<%If FSDoFMonth = "05" Then Response.Write("selected")%>>May</option>
<option value="06"<%If FSDoFMonth = "06" Then Response.Write("selected")%>>June</option>
<option value="07"<%If FSDoFMonth = "07" Then Response.Write("selected")%>>July</option>
<option value="08"<%If FSDoFMonth = "08" Then Response.Write("selected")%>>August</option>
<option value="09"<%If FSDoFMonth = "09" Then Response.Write("selected")%>>September</option>
<option value="10"<%If FSDoFMonth = "10" Then Response.Write("selected")%>>October</option>
<option value="11"<%If FSDoFMonth = "11" Then Response.Write("selected")%>>November</option>
<option value="12"<%If FSDoFMonth = "12" Then Response.Write("selected")%>>December</option>
</SELECT>
<SELECT name="FSDoFDay">
<SCRIPT language="JavaScript">
document.write(WriteDoFOptions(31));
</SCRIPT>
</SELECT>
<SELECT name="FSDoFYear" onchange="ChangeOptionDays('FSDoF')">
<SCRIPT language="JavaScript">
document.write(WriteDoFYearOptions(200));
</SCRIPT>
</SELECT>
</td>
</tr>
<tr>
<td>
<input type="Submit" value="Submit">
</td>
</tr>
</table>
</FORM>
</body>
<%End Sub '''''''''''''''''''''''''''''''''''''''''''%>
<%Sub ConfirmObit() '''''''''''''''''''''''''''''''''''%>
<form name="Form2" action="#" method="post">
<table border="0" width="80%">
<tr>
<td align="right" width="25%">
<font color="red">Date Of Funeral: </font>
</td>
<td>
<%
If Request.Form("FSDoFMonth")<>"" Then
If Request.Form("FSDoFMonth") = "01" Then Response.Write "January"
If Request.Form("FSDoFMonth") = "02" Then Response.Write "February"
If Request.Form("FSDoFMonth") = "03" Then Response.Write "March"
If Request.Form("FSDoFMonth") = "04" Then Response.Write "April"
If Request.Form("FSDoFMonth") = "05" Then Response.Write "May"
If Request.Form("FSDoFMonth") = "06" Then Response.Write "June"
If Request.Form("FSDoFMonth") = "07" Then Response.Write "July"
If Request.Form("FSDoFMonth") = "08" Then Response.Write "Augest"
If Request.Form("FSDoFMonth") = "09" Then Response.Write "September"
If Request.Form("FSDoFMonth") = "10" Then Response.Write "October"
If Request.Form("FSDoFMonth") = "11" Then Response.Write "November"
If Request.Form("FSDoFMonth") = "12" Then Response.Write "December"
Response.Write (" ")
Response.Write Request.Form("FSDoFDay")
Response.Write (", ")
Response.Write Request.Form("FSDoFYear")
End If
%>
</td>
</tr>
<tr>
<td align="center" colspan="2">
<b>If The Information Is Not Correct Please Click The Back Button To Correct Any Mistakes</b><br />
</td>
</tr>
<tr>
<td align="center" colspan="2">
<input type="hidden" name="dcheck" value="<%=dcheck%>">
<input type="hidden" name="FSDoFMonth" value="<%=FSDoFMonth%>">
<input type="hidden" name="FSDoFDay" value="<%=FSDoFDay%>">
<input type="hidden" name="FSDoFYear" value="<%=FSDoFYear%>">
<input type="submit" value="Go Back" onClick="this.form.action='Drop%20Down%20Calander.asp';">
</td>
</tr>
</table>
</form>
<%End Sub '''''''''''''''''''''''''''''''''''''''''''%>
</html>