- Joined
- 29 May 2002
- Messages
- 820
Hey guys..
I've thrown together a script that only works in IE.. because I use document.elements to sum form values.
Firefox doesnt like that. Firefox needs document.getElementsbyID
I have no idea how to implement this...
With input fields:
$pstat is a variable...$pstat = "player_stat_goals03[]";
My question is probably not as simple as.. how do I implement this to work in firefox. I tried changing the NAME to ID, but that pretty much did nothing. When I look at javascript and DOM I get a headache instantly. Is there any OSNN'r around that feels comfortable it?
thanks for any help!
I've thrown together a script that only works in IE.. because I use document.elements to sum form values.
Firefox doesnt like that. Firefox needs document.getElementsbyID
I have no idea how to implement this...
Code:
<script>
function addscore".$teamid."(obj)
{
var total = 0;
var tmp=0;
for (i=0; i< enterscore.elements['".$pstat."'].length; i++)
{
tmp =Number(enterscore.elements['".$pstat."'][i].value);
total = Number(total + tmp);
}
enterscore.totgoals".$teamid.".value=total;
}
</script>
With input fields:
Code:
<Input TYPE='text' NAME='$pstat' value='0' onChange = 'addscore".$teamid."(this)' onblur = 'submitForms".$teamid."(this)' MAXLENGTH='2' SIZE='2'>
$pstat is a variable...$pstat = "player_stat_goals03[]";
My question is probably not as simple as.. how do I implement this to work in firefox. I tried changing the NAME to ID, but that pretty much did nothing. When I look at javascript and DOM I get a headache instantly. Is there any OSNN'r around that feels comfortable it?
thanks for any help!