No, that can't be the reason. Did you validate your markup?
yes. HTML 4.0 clean by w3c.org
Which
rendering mode is used?
Not sure i understand: Is it this?
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"
http://www.w3.org/TR/1998/REC-html40-19980424/loose.dtd">
Does the div contain anything else besides text?
A said:
Other than that I have to agree with rf, show us a reduced example
(preferably) or a link to the page with the problem.
That latter is hard.
Its a database giving access to commercial info, behind a firewall..
The function tht does the change is this
function do_discount()
{
var grand_total=document.getElementsByName('grand_total')[0].value;
var order_cost=document.getElementsByName('order_cost')[0].value;
var order_total=document.getElementsByName('order_total')[0].value;
var discount=order_total-grand_total;
document.getElementsByName('discount')[0].value=Math.round(discount*100);
document.getElementsByName('update')[0].value='yes';
var margin=Math.round((grand_total-order_cost)*100)/100;
var margin_string="<b>Margin: </b>"+margin+" :
"+Math.round(margin*100/grand_total)+ "%";
document.getElementById('sales_margin').innerHTML=margin_string;
}
That works. There are hidden input fields covering the various
getelementsbyname stuff.
The target div is this in php
<div style="position: absolute; left: 5px; top: -3px; text-align:
right"><INPUT onchange="do_discount()" style="width: 90px;" type="TEXT"
maxlength="31" size="10" name="grand_total" value ="<? echo
$grand_total; ?>"></div>
<div id="sales_margin" style="font-weight: normal; position: absolute;
top: 0px;left: 110px;width: 140px; text-align: left;"><b>Margin:</b><?
printf (" %0.02f: %3.0f%%",$margin, $margin*100/$grand_total);?> </div>
Here is an actual source of it in use..
<div style="position: absolute; top: 8px;left: 750px;width: 100px;
text-align: right;">
<div style="position: absolute; left: 5px; top: -3px; text-align: right">
<INPUT onchange="do_discount()" style="width: 90px;" type="TEXT"
maxlength="31" size="10" name="grand_total" value ="22.9">
</div>
<div id="sales_margin" style="font-weight: normal; position: absolute;
top: 0px;left: 110px;width: 140px; text-align: left;"><b>Margin:</b>
7.07: 31% </div>
</div>