greatfalls
Technical User
I am not sure what is wrong with the following.
Any advice would be greatly appreciated.
I have a input page, using a form with the following code:
<form name="pensionBenefits" method="post" action="output_civilian_e.cfm"
and am passing to a output page using
<cfoutput>
the input page uses a dynamic javascript to display the current year and the last 4 years and is suppose to pass the years to the output page.
The following is the script and the way I have it set up.
<tr>
<!---these history years fields should stay as hidden fields --->
<input type="hidden" name="historyYearCur">
<input type="hidden" name="historyYearLessOne">
<input type="hidden" name="historyYearLessTwo">
<input type="hidden" name="historyYearLessThree">
<input type="hidden" name="historyYearLessFour">
<!---these history years fields should stay as hidden fields --->
<script language="JavaScript">
<!-- // Begins
var fldAry = new Array();
fldAry[0] = document.pensionBenefits.historyYearCur;
fldAry[1] = document.pensionBenefits.historyYearLessOne;
fldAry[2] = document.pensionBenefits.historyYearLessTwo;
fldAry[3] = document.pensionBenefits.historyYearLessThree;
fldAry[4] = document.pensionBenefits.historyYearLessFour;
var currYear = new Date();
currYear = currYear.getFullYear();
for (var i=0; i<fldAry.length; i++) {
fldAry.value = (currYear--);
document.writeln('<td width="98" align="center" class="out">'+fldAry.value+'</td>');
}
document.writeln('<td class="out"> </td>');
// Ends -->
</script>
</tr>
and output as follows:
#historyYearCur#
#historyYearLessOne# ,etc
The following is what I see viewing from the browsers:
****netscape***
<input type="hidden" name="historyYearCur">
<input type="hidden" name="historyYearLessOne">
<input type="hidden" name="historyYearLessTwo">
<input type="hidden" name="historyYearLessThree">
<input type="hidden" name="historyYearLessFour">
<script language="JavaScript">
<!C- // Begins
var f<TD width="98" align="center" class="out">2001</TD>
<TD width="98" align="center" class="out">2000</TD>
<TD width="98" align="center" class="out">1999</TD>
<TD width="98" align="center" class="out">1998</TD>
<TD width="98" align="center" class="out">1997</TD>
<TD class="out"> </TD>
***IE****
<input type="hidden" name="historyYearCur">
<input type="hidden" name="historyYearLessOne">
<input type="hidden" name="historyYearLessTwo">
<input type="hidden" name="historyYearLessThree">
<input type="hidden" name="historyYearLessFour">
<script language="JavaScript">
<!-- // Begins
var fldAry = new Array();
fldAry[0] = document.pensionBenefits.historyYearCur;
fldAry[1] = document.pensionBenefits.historyYearLessOne;
fldAry[2] = document.pensionBenefits.historyYearLessTwo;
fldAry[3] = document.pensionBenefits.historyYearLessThree;
fldAry[4] = document.pensionBenefits.historyYearLessFour;
var currYear = new Date();
currYear = currYear.getFullYear();
for (var i=0; i<fldAry.length; i++) {
fldAry.value = (currYear--);
document.writeln('<td width="98" align="center" class="out">'+fldAry.value+'</td>');
}
document.writeln('<td class="out"> </td>');
// Ends -->
</script>
Any advice would be greatly appreciated.
I have a input page, using a form with the following code:
<form name="pensionBenefits" method="post" action="output_civilian_e.cfm"
and am passing to a output page using
<cfoutput>
the input page uses a dynamic javascript to display the current year and the last 4 years and is suppose to pass the years to the output page.
The following is the script and the way I have it set up.
<tr>
<!---these history years fields should stay as hidden fields --->
<input type="hidden" name="historyYearCur">
<input type="hidden" name="historyYearLessOne">
<input type="hidden" name="historyYearLessTwo">
<input type="hidden" name="historyYearLessThree">
<input type="hidden" name="historyYearLessFour">
<!---these history years fields should stay as hidden fields --->
<script language="JavaScript">
<!-- // Begins
var fldAry = new Array();
fldAry[0] = document.pensionBenefits.historyYearCur;
fldAry[1] = document.pensionBenefits.historyYearLessOne;
fldAry[2] = document.pensionBenefits.historyYearLessTwo;
fldAry[3] = document.pensionBenefits.historyYearLessThree;
fldAry[4] = document.pensionBenefits.historyYearLessFour;
var currYear = new Date();
currYear = currYear.getFullYear();
for (var i=0; i<fldAry.length; i++) {
fldAry.value = (currYear--);
document.writeln('<td width="98" align="center" class="out">'+fldAry.value+'</td>');
}
document.writeln('<td class="out"> </td>');
// Ends -->
</script>
</tr>
and output as follows:
#historyYearCur#
#historyYearLessOne# ,etc
The following is what I see viewing from the browsers:
****netscape***
<input type="hidden" name="historyYearCur">
<input type="hidden" name="historyYearLessOne">
<input type="hidden" name="historyYearLessTwo">
<input type="hidden" name="historyYearLessThree">
<input type="hidden" name="historyYearLessFour">
<script language="JavaScript">
<!C- // Begins
var f<TD width="98" align="center" class="out">2001</TD>
<TD width="98" align="center" class="out">2000</TD>
<TD width="98" align="center" class="out">1999</TD>
<TD width="98" align="center" class="out">1998</TD>
<TD width="98" align="center" class="out">1997</TD>
<TD class="out"> </TD>
***IE****
<input type="hidden" name="historyYearCur">
<input type="hidden" name="historyYearLessOne">
<input type="hidden" name="historyYearLessTwo">
<input type="hidden" name="historyYearLessThree">
<input type="hidden" name="historyYearLessFour">
<script language="JavaScript">
<!-- // Begins
var fldAry = new Array();
fldAry[0] = document.pensionBenefits.historyYearCur;
fldAry[1] = document.pensionBenefits.historyYearLessOne;
fldAry[2] = document.pensionBenefits.historyYearLessTwo;
fldAry[3] = document.pensionBenefits.historyYearLessThree;
fldAry[4] = document.pensionBenefits.historyYearLessFour;
var currYear = new Date();
currYear = currYear.getFullYear();
for (var i=0; i<fldAry.length; i++) {
fldAry.value = (currYear--);
document.writeln('<td width="98" align="center" class="out">'+fldAry.value+'</td>');
}
document.writeln('<td class="out"> </td>');
// Ends -->
</script>