• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: Total Field

Total Field 12 years 3 months ago #20810

  • spd54
  • spd54's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 5
I have created a form based on another I use which works fine however in the new one the Total Text field isn't being updated when the product is selected.

Anyone have any ideas why this may be so.

Thanks

Steve
The administrator has disabled public write access.

Total Field 12 years 3 months ago #20811

Hi,
Did you check any scripting that may be looking for a different component ID?

I'm not a programmer but that has tripped me up a couple of times when I was doing a hidden field counter code.

Good Luck,
K
The administrator has disabled public write access.

Total Field 12 years 3 months ago #20822

  • spd54
  • spd54's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 5
even tries a simple form with one product. Here's the code if anyone can see where it's going wrong would appreciate it.

<script type="text/javascript">
function enableQuantity(prod,quantity)
{
if(document.getElementById(prod).checked)
document.getElementById(quantity).disabled = false;

else
document.getElementById(quantity).disabled = true;
calculateTotal();

}

function calculateTotal()
{
var products = new Array("Product10");
var i=0;
var total = 0;
for(i;i<products.length;i++)
if(document.getElementById(products).checked)
{

//alert(document.getElementById("QuantityProd"+(i+1)).value);
total = total + parseInt(document.getElementById(products).value) * parseInt(document.getElementById('QuantityProd'+(i+1)).value);
}
document.getElementById('Total').value = total;
}
</script>
<div class="componentheading">{global:formtitle}</div>
{error}
<table class="formTableLayout" border="0">
<tr class="rsform-block rsform-block-product1">
<td>{Product1:caption}</td>
<td>{Product1:body}<div class="formClr"></div>{Product1:validation}</td>
<td>{Product1:description}</td>
</tr>
<tr class="rsform-block rsform-block-quantityprod1">
<td>{QuantityProd1:caption}</td>
<td>{QuantityProd1:body}<div class="formClr"></div>{QuantityProd1:validation}</td>
<td>{QuantityProd1:description}</td>
</tr>
<tr class="rsform-block rsform-block-total">
<td>{Total:caption}</td>
<td>{Total:body}<div class="formClr"></div>{Total:validation}</td>
<td>{Total:description}</td>
</tr>
</table>
<script type="text/javascript">
enableQuantity('Product10','QuantityProd1');
</script>
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!