• 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: Calculte TextBox example TextBox Calculations help

Calculte TextBox example TextBox Calculations help 11 years 2 months ago #26785

  • vega55
  • vega55's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 7
demo.rsjoomla.com/calculation-form-example

TextBox Calculations

html code
<div class="componentheading">{global:formtitle}</div>
{error}
<table border="0">
	<tr class="rsform-block rsform-block-field1">
		<td>{field1:caption}</td>
		<td>{field1:body}<div class="formClr"></div>{field1:validation}</td>
		<td>{field1:description}</td>
	</tr>
	<tr class="rsform-block rsform-block-field2">
		<td>{field2:caption}</td>
		<td>{field2:body}<div class="formClr"></div>{field2:validation}</td>
		<td>{field2:description}</td>
	</tr>
	<tr class="rsform-block rsform-block-calculate">
		<td>{Calculate:caption}</td>
		<td>{Calculate:body}<div class="formClr"></div>{Calculate:validation}</td>
		<td>{Calculate: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>

javascript code
function calculateText(){
 
var op1=document.getElementById('field1');
 
var op2=document.getElementById('field2');
 
var result=document.getElementById('Total');
 
if(op1.value=="" || op1.value!=parseFloat(op1.value)) op1.value=0;
 
if(op2.value=="" || op2.value!=parseFloat(op2.value)) op2.value=0;
 
result.value=0;
 
result.value=parseInt(result.value);
 
result.value=parseInt(result.value)+parseInt(op1.value)+parseInt(op2.value);}


How do I
5x7 =35
35x1.5$
result:52.5$

field1 x field2 hidden = ?? x 1.5
total : 00

please help me :(
Last Edit: 11 years 2 months ago by vega55.
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!