Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

passing value - works in IE and not in Netscape

Status
Not open for further replies.

greatfalls

Technical User
Jul 1, 2001
21
0
0
CA
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=&quot;pensionBenefits&quot; method=&quot;post&quot; action=&quot;output_civilian_e.cfm&quot;
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=&quot;hidden&quot; name=&quot;historyYearCur&quot;>
<input type=&quot;hidden&quot; name=&quot;historyYearLessOne&quot;>
<input type=&quot;hidden&quot; name=&quot;historyYearLessTwo&quot;>
<input type=&quot;hidden&quot; name=&quot;historyYearLessThree&quot;>
<input type=&quot;hidden&quot; name=&quot;historyYearLessFour&quot;>
<!---these history years fields should stay as hidden fields --->
<script language=&quot;JavaScript&quot;>
<!-- // 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=&quot;98&quot; align=&quot;center&quot; class=&quot;out&quot;>'+fldAry.value+'</td>');
}
document.writeln('<td class=&quot;out&quot;> </td>');
// Ends -->
</script>
</tr>

and output as follows:
#historyYearCur#
#historyYearLessOne# ,etc

The following is what I see viewing from the browsers:
****netscape***

<input type=&quot;hidden&quot; name=&quot;historyYearCur&quot;>
<input type=&quot;hidden&quot; name=&quot;historyYearLessOne&quot;>
<input type=&quot;hidden&quot; name=&quot;historyYearLessTwo&quot;>
<input type=&quot;hidden&quot; name=&quot;historyYearLessThree&quot;>
<input type=&quot;hidden&quot; name=&quot;historyYearLessFour&quot;>

<script language=&quot;JavaScript&quot;>

<!C- // Begins
var f<TD width=&quot;98&quot; align=&quot;center&quot; class=&quot;out&quot;>2001</TD>
<TD width=&quot;98&quot; align=&quot;center&quot; class=&quot;out&quot;>2000</TD>
<TD width=&quot;98&quot; align=&quot;center&quot; class=&quot;out&quot;>1999</TD>
<TD width=&quot;98&quot; align=&quot;center&quot; class=&quot;out&quot;>1998</TD>
<TD width=&quot;98&quot; align=&quot;center&quot; class=&quot;out&quot;>1997</TD>
<TD class=&quot;out&quot;> </TD>

***IE****

<input type=&quot;hidden&quot; name=&quot;historyYearCur&quot;>
<input type=&quot;hidden&quot; name=&quot;historyYearLessOne&quot;>
<input type=&quot;hidden&quot; name=&quot;historyYearLessTwo&quot;>
<input type=&quot;hidden&quot; name=&quot;historyYearLessThree&quot;>
<input type=&quot;hidden&quot; name=&quot;historyYearLessFour&quot;>

<script language=&quot;JavaScript&quot;>
<!-- // 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=&quot;98&quot; align=&quot;center&quot; class=&quot;out&quot;>'+fldAry.value+'</td>');
}
document.writeln('<td class=&quot;out&quot;> </td>');
// Ends -->
</script>
 
Are the values being passed all FORM values, or are there any URL values. If so, remember to use &quot;URLencodedFormat()&quot;, IE will automatically through in the %20%, where Netscape will not and will cause an error if there is a space in the URL line.

Hope this helps?

David Moore
SBE
 
dmoore,
Thanks for your reply, all the values being passed are inside a form, there are not urls.

Any other ideas?
 
I have just discovered that the hidden script causes the page to not print in Netscape. So I guess I can't use it at all any way.

How can I get the dates to display in the input page (form) and pass them to the output page?

 
Well, what I was trying to do was display the current year, and the last 4 previous years (on the input page - or a form). That wasn't a problem, but then - in the form - I was trying to pass and display them on the output page, which is a cfm page and am curently using a <cfoutput> for the output page. It must be possible, but it has given me alot of problems of one sort or another.
Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top