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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

javascript page loading incorrectly on Apache, ok with IIS

Status
Not open for further replies.

mattie25

Programmer
Joined
Aug 3, 2004
Messages
1
Location
IE
When I include several javascript functions in the head section, the page loads incorrectly using apache.
It works ok if I launch it using dreamweaver or IIS.

The java script works but some of the HTML commands are shown at the top of the page.

The following appears at the top of the page

="hidden" id="agency" value="%">

content="text/html; charset=iso-8859-1">


The complete html for the page is as follows


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="rte.css" rel="stylesheet" type="text/css">

<script language="JavaScript">

function select_year(){
var today=new Date();
var counter=0;;
var date_select="";
var this_year = today.getYear();
document.write("<select name=year size=1>");

for (counter = this_year; counter > 2001 ; counter--){
date_select ="";
if (counter == today.getYear()){
date_select="selected ";
}
document.write ("<option " + date_select + "value=" + counter +">" + counter);


}

document.write("</select>");
}



function select(box){
document.form1.reporttype[box].checked = true;
}


function select_month(){
var today1=new Date();
var month_name = new Array ("January","February","March","April","May","June","July","August","September","October","November","December");
var mth_select="";
var mth_ref="";
var counter=0;

document.write("<select name=month size=1>");

for (counter = 0; counter < 12; counter++){
mth_select="";

if (counter == today1.getMonth()){
var mth_select="selected ";
}
mth_ref = counter +1;
document.write ("<option " + mth_select + "value=" + mth_ref +">" + month_name[counter]);

}

document.write("</select>");
}


</script>


</head>

<body>
<h1 align = 'center'>Reports 6:36</h1>

<form name="form1" method="get" action='/cgi-bin/rtesales/report.cgi' >

<table width="25%" border="0" align = 'center'>
<tr>
<td>Year</td>
<td><script>select_year()</script>

</td>
</tr>

<tr><td>Month</td>
<td><script>select_month()</script>
</td></tr>

<tr>
<td>Group</td>
<td><select name="group" id="group">
<option value="%" selected>All
<option value="R1">R1
<option value="R2">R2
<option value="R4">R4
<option value="R5">R5
<option value="R6">R6
<option value="RA">RA
</select>
</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Period</td>
<td><input name="timeperiod" type="radio" value="3" checked>
Quarter</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><input type="radio" name="timeperiod" value="6">
6 Months</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><input type="radio" name="timeperiod" value="12">
12 Months</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td colspan ="2">Order by revenue
<input name="order" type="checkbox" id="order" value="revenue" checked></td>
</tr>
</table>
<p align = 'center'>Select report from table below</p>

<table width="25%" border="1" align = 'center'>
<tr>
<td><a href= "javascript:select('0')">
<input name="reporttype" type="radio" value="Group" checked>
Group_Report</a></td>
</tr>
<tr>
<td><a href= "javascript:select('1')" >
<input type="radio" name="reporttype" value="Agency">
Agency by Month</a></td>
</tr>
<tr>
<td><a href= "javascript:select('2')">
<input type="radio" name="reporttype" value="Client">
Client by Month</a></td>
</tr>
<tr>
<td><a href= "javascript:select('3')">
<input name="reporttype" type="radio" value="Agency_Client">
Agency_Client by Month</a></td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
</table>

<p align = 'center'>
<input type="submit" name="Submit" value="Submit">
<input name="agency" type="hidden" id="agency" value="%">
<input name="client" type="hidden" id="client" value="%">
</p>

</form>



</body>
</html>
 
Can you give us a link to the actual site so we can take a peek?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top