Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Foxed by FIre Fox DEcimal Point bug 1

Status
Not open for further replies.

xprienced

Technical User
Oct 26, 2007
2
FOllowing script works in IE and shows Decimal Points .... BUT FIREFOX just ignores the Decimal Points. ANY CLUES?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "<html xmlns="<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<script language="javascript1.2">
function calcu()
{
var value1=0.00;


value1 = (document.form1.r1.value * document.form1.q1.value)




myvar =(parseFloat(value1))
document.form1.subt.value=myvar
alert(myvar)
}
</script>
</head>

<body>


<p><b><form id="form1" name="form1" method="post" action="">

QTY
<select name="q1">
<option value="0" selected="selected">0</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
<option value="13">13</option>
<option value="14">14</option>
<option value="15">15</option>
</select>
<b>
Rate
<input type="text" name="r1" value="78.99" />
</b> </p>

<p><br />
<br />
Sub Total
<input type="text" name="subt" size="7" maxlength="3" class="formbrdr" />
</p>
<p>
<input type="button" name="Button" value="Calc" onclick="calcu()" />
</p></form>
</body>
</html>
 
The cause is maxlength rather than anything else.
><input type="text" name="subt" size="7" maxlength="3" class="formbrdr" />
[tt]<input type="text" name="subt" size="7" class="formbrdr" />[/tt]
ps: Watch out your wording. "Bug"? on ff? People will jump on you.
 


;) ;) ;) ;) ;) ;)


Culprit is maxlength="3"

And I was blaming Fire Fox ......


SOME ONE please close this thread :) :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top