• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

why doesnt this *very simple* code work in IE?

unsped

Platinum Member
<head><title>test</title>
<script type="text/javascript">
function recalc()
{

document.testform.c1.value = 2;

}


</script>
</head>

<body>
<form action="" method="POST" name="testform" >
<input name="c1" type="text" size="15" maxlength="15">
</form>
<input name="LALA" value="Click Here" onclick="recalc()" type="button">
</body>
</html>
 
heh i'm having the opposite problem. mine is working fine in IE but not in Firefox ... its not lining up stuff correctly in Firefox.
 
Did you accidentally leave out the opening <html> tag? Might not be the cause of the problem, but stuff might get weird if the DOM tree isn't correct
 
for the sake of completion, i added all the tags i could think of, same problem.

******************

<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>test</title>
<style>
</style>

<script type="text/javascript">
function recalc()
{
document.testform.c1.value = 2;
}


</script>
</head>
<body>
<form action="test.php" method="POST" name="testform" id="testform">
<input name="c1" type="text" size="15" maxlength="15" id="c1">
<input name="LALA" value="Click Here" onclick="recalc()" type="button">
</form>

</body>
</html>
 
I wonder if it has anything to do with the new IE local security policies in XP SP2. I clicked on "Allow Active Content", but perhaps the JavaScript call is being blocked anyway.
 
i figured it out,

ie doesnt like the function being called recalc()
change the name and it works, must be a reserved function or something.
 
Originally posted by: unsped
i figured it out,

ie doesnt like the function being called recalc()
change the name and it works, must be a reserved function or something.

hmm i actually thought about that but recalc() doesn't seem like a likely conflict 😕

something is screwy with IE's JS namespace.

something other functions that don't work:
encode
decode
.
.
.

there was a bunch of it that gave me the same headache too but can't remember which were them.. maybe I should put it up as i stumble upon it
 
Back
Top