Page 1 of 1
Java script alert problem in IE6
Posted: Thu Oct 02, 2003 2:24 am
by valen53
Testing PC.
PC1 : w2k, IE5 ;
PC2 : win98 IE6
alert1.php
Code: Select all
<?
if ( $Submit == 'Submit' ) {
echo'
<script language="JavaScript1.2">
alert("Data updated ! ");
</script>';
}
?>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<form name="form1" method="post" action="alert1.php">
<input type="submit" name="Submit" value="Submit">
</form>
</body>
</html>
PC1 : correctly, alert the message one time
PC2 : wrongly, alert the message twice time
anybody face this problem b4 ? is it IE6 setting problem ?
Posted: Thu Oct 02, 2003 8:10 am
by Derfel Cadarn
After changing one line into the following:
Code: Select all
<?php
if ( $_POST['Submit'] == 'Submit' ) {
?>
it worked fine in Mozilla with me.
Posted: Thu Oct 02, 2003 8:12 am
by igoy
well... will and without register_globals on..
when i tested this code on XP system with ie6 (sp1).. it worked fine..
I suppose your problem must be with your ie6 settings.
Posted: Thu Oct 02, 2003 10:21 am
by scorphus
Make PHP to write the <script...>...</script> tag inside <head> tag. I may be the reason why PC2 wont display the alert. Changed to:
Code: Select all
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<?
if ( $Submit == 'Submit' ) {
echo'
<script language="JavaScript1.2">
alert("Data updated ! ");
</script>';
}
?>
</head>
<body>
<form name="form1" method="post" action="alert1.php">
<input type="submit" name="Submit" value="Submit">
</form>
</body>
</html>
The <script> was before <html> tag and it doesn't complies with standard HTML specification.
Cheers,
Scorphus.
Posted: Thu Oct 02, 2003 1:39 pm
by m3rajk
i'm going to have to agree with scorphus for two reasons:
1: it's better to conform to standards since it makes your site more widely compatable, and may cause issues like that if you don't.
2: when i had an issue with javascript he fixed it in about 30 seconds, so he obviously knows it, and from what i've seen looking around this forum, he knows it well
Posted: Fri Oct 03, 2003 1:54 am
by valen53
it was working when changing the code like
Code: Select all
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<?
if ( $Submit == 'Submit' ) {
echo'
<script language="JavaScript1.2">
alert("Data updated ! ");
</script>';
}
?>
</head>
thanks for reply
Posted: Fri Oct 03, 2003 2:14 am
by igoy
Head.. HEAD... HeAd.... eeeeeeeeeeeeeee..
why the hell that didn't occured to me ??????....
first.. I was stupid enough to think there is no problem with it since it ran properly on my system.
second.. rule braking has got me so much that i have started to forget thing called "standard"
dobby musdt punish himself... err.. yogi must punish himself....