purnendu2311
05-10-2007, 02:09 PM
Hi all
I am getting the problem in displaying the value. once i select quentity one, the cost should be 9.95. once i will select the quentity as 2 , the cost sould be 19.90. once i select 3, cost should be 29.85. I am getting the value.
But the problem is that , i want to select quentity as 2, the value shoud come 19.90 but infact it is coming 19.9 only.
<script>function changePrice()
{
//document.f1.selectQty.value
//document.f1.price.value=Math.round((document.f1.selectQty.value*9.95)*100)/100;
document.f1.price.value=Math.abs((document.f1.selectQty.value*9.95)*100)/100;
}
</script>
<table width="100%" border="0" cellpadding="6" cellspacing="0" bgcolor="#F3F5FC" class="blueborder">
<form name="f1" method="post" onSubmit="return validate();" >
<tr>
<td width="47%" align="left" valign="middle"><H3>Tuxedo
Blue Diamond Prepaid Maestro Card </H3></td>
<td width="31%" align="center" valign="middle"><H3>Quantity:
<select name="selectQty" id="selectQty" onChange="changePrice();">
<option value="1" selected>1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
</H3></td>
<td width="22%" align="right" valign="middle"><h3><span class="div-align">
Cost: <span class="style1">£</span>
<input name="price" class="form"
id="price" value="9.95" size="8" />
</span></h3></td>
</tr>
</form>
</table>
<script>function changePrice()
{
//document.f1.selectQty.value
//document.f1.price.value=Math.round((document.f1.selectQty.value*9.95)*100)/100;
document.f1.price.value=Math.abs((document.f1.selectQty.value*9.95)*100)/100;
}
</script>
please give me the solution, It is urgent.
Thanks & Regards
Ranjan
I am getting the problem in displaying the value. once i select quentity one, the cost should be 9.95. once i will select the quentity as 2 , the cost sould be 19.90. once i select 3, cost should be 29.85. I am getting the value.
But the problem is that , i want to select quentity as 2, the value shoud come 19.90 but infact it is coming 19.9 only.
<script>function changePrice()
{
//document.f1.selectQty.value
//document.f1.price.value=Math.round((document.f1.selectQty.value*9.95)*100)/100;
document.f1.price.value=Math.abs((document.f1.selectQty.value*9.95)*100)/100;
}
</script>
<table width="100%" border="0" cellpadding="6" cellspacing="0" bgcolor="#F3F5FC" class="blueborder">
<form name="f1" method="post" onSubmit="return validate();" >
<tr>
<td width="47%" align="left" valign="middle"><H3>Tuxedo
Blue Diamond Prepaid Maestro Card </H3></td>
<td width="31%" align="center" valign="middle"><H3>Quantity:
<select name="selectQty" id="selectQty" onChange="changePrice();">
<option value="1" selected>1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
</H3></td>
<td width="22%" align="right" valign="middle"><h3><span class="div-align">
Cost: <span class="style1">£</span>
<input name="price" class="form"
id="price" value="9.95" size="8" />
</span></h3></td>
</tr>
</form>
</table>
<script>function changePrice()
{
//document.f1.selectQty.value
//document.f1.price.value=Math.round((document.f1.selectQty.value*9.95)*100)/100;
document.f1.price.value=Math.abs((document.f1.selectQty.value*9.95)*100)/100;
}
</script>
please give me the solution, It is urgent.
Thanks & Regards
Ranjan