Hi,
I have a javascript function that does a calculation and displays the result in the third function.The function is triggered by onblur function.It does not seem to work in IE nor Firefox.
Please help me.
[HTML]<script>
function probability()
{
var val1 = parseInt(docume nt.getElementBy Id('percentageg o').value);
var val2 = parseInt(docume nt.getElementBy Id('percentagew in').value);
var ansd = document.getEle mentById('proba bility');
ansd.value = Math.round((val 1 * val2)/100);
}
</script>
<th class="bodyText " align="right">% Go: </th>
<td class="bodyText " colspan="2"><in put type="text" id="percentageg o" name="percentag ego" value="<?php
if (!empty($percen tagego)) {
echo number_format($ percentagego,0) ;
}?>" maxlength="20" size="17"></td>
</tr>
<tr>
<th class="bodyText " align="right">% Win:   ;</th>
<td class="bodyText " colspan="2"><in put type="text" id="percentagew in" name="percentag ewin" onBlur="probabi lity()" value="<?php
if (!empty($percen tagewin)) {
echo number_format($ percentagewin,0 );
}?>" maxlength="20" size="17"></td>
</tr>
<tr>
<th class="bodyText " align="right">P robability:&nbs p; </th>
<td class="bodyText " colspan="2"><in put type="text" onBlur="probabi lity()" name="probabili ty" id="probability " value="" maxlength="3" size="5"></td>
</tr>[/HTML]
I have a javascript function that does a calculation and displays the result in the third function.The function is triggered by onblur function.It does not seem to work in IE nor Firefox.
Please help me.
[HTML]<script>
function probability()
{
var val1 = parseInt(docume nt.getElementBy Id('percentageg o').value);
var val2 = parseInt(docume nt.getElementBy Id('percentagew in').value);
var ansd = document.getEle mentById('proba bility');
ansd.value = Math.round((val 1 * val2)/100);
}
</script>
<th class="bodyText " align="right">% Go: </th>
<td class="bodyText " colspan="2"><in put type="text" id="percentageg o" name="percentag ego" value="<?php
if (!empty($percen tagego)) {
echo number_format($ percentagego,0) ;
}?>" maxlength="20" size="17"></td>
</tr>
<tr>
<th class="bodyText " align="right">% Win:   ;</th>
<td class="bodyText " colspan="2"><in put type="text" id="percentagew in" name="percentag ewin" onBlur="probabi lity()" value="<?php
if (!empty($percen tagewin)) {
echo number_format($ percentagewin,0 );
}?>" maxlength="20" size="17"></td>
</tr>
<tr>
<th class="bodyText " align="right">P robability:&nbs p; </th>
<td class="bodyText " colspan="2"><in put type="text" onBlur="probabi lity()" name="probabili ty" id="probability " value="" maxlength="3" size="5"></td>
</tr>[/HTML]
Comment