Forum Moderators: coopster
The code works great on IE without any problem however in FireFox I get a blank page. I look at the source code and it has all of the code for the page however the page does not get displayed unless I hit the refresh button.
Here is the code. Can someone help me?
<?php
$changeURL = $_POST['changeURL'];
if ($changeURL == 1)
{
echo <<<EOF
<SCRIPT TYPE="text/javascript">
window.location = window.location.href+'#uploadSection';
</SCRIPT>
EOF;
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>InterChange: Administrative Upload</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<form name="testAnchor" method="post" action="testAnchor.php" enctype="multipart/form-data">
<input type="hidden" name="changeURL" value=1>
<input type="button" name="Test" value="Test" onClick="submit();return false;">
<input type="checkbox" name="TestCheckBox">
<a name="#uploadSection"></a>
</form>
</body>
</html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>InterChange: Administrative Upload</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<?php
$changeURL = $_POST['changeURL'];
if ($changeURL == 1)
{
echo <<<EOF
<SCRIPT TYPE="text/javascript">
window.location = window.location.href+'#uploadSection';
</SCRIPT>
EOF;
}
?>
</head>
<body>
<form name="testAnchor" method="post" action="testAnchor.php" enctype="multipart/form-data">
<input type="hidden" name="changeURL" value=1>
<input type="button" name="Test" value="Test" onClick="submit();return false;">
<input type="checkbox" name="TestCheckBox">
<a name="#uploadSection"></a>
</form>
</body>
</html>
Michal Cibor
I created another JavaScript by the name of
docLoaded. I called the JavaScript on the body tag using the onLoad attribute.
<body onLoad="docLoaded()">
In the docLoaded javascript I have the following code
<?php
$changeURL = $_POST['changeURL'];
if ($changeURL == 1)
{
echo <<<EOF
<SCRIPT TYPE="text/javascript">
window.location = window.location.href+'#uploadSection';
</SCRIPT>
EOF;
}
?>
After the modification, the application works on Mozilla.
I think that Mozilla does not support forward referencing to a name tag. It works fine in IE.
So in Mozilla, the page has to be loaded first and then we can jump to an internal link.