calculation of cost...im a newbie in using chronoform

kayrie 25 Aug, 2011
hello guys,i guess u might help me as im a total newbie of using this chronoforms...
i want to make a auto-calculate for the cost...

example : cost 1 = 20
cost 2= 40
total =40...

diz iz my example form
and i hope u can give me the php code and
where to put it...

<div class="form_item">
  <div class="form_element cf_textbox">
    <label class="cf_label" style="width: 150px;">Cost 1</label>
    <input class="cf_inputbox" maxlength="150" size="30" title="" id="text_2" name="L_cost1" type="text" />
  
  </div>
  <div class="cfclear"> </div>
</div>

<div class="form_item">
  <div class="form_element cf_textbox">
    <label class="cf_label" style="width: 150px;">Cost 2</label>
    <input class="cf_inputbox" maxlength="150" size="30" title="" id="text_0" name="L_cost2" type="text" />
  
  </div>
  <div class="cfclear"> </div>
</div>

<div class="form_item">
  <div class="form_element cf_textbox">
    <label class="cf_label" style="width: 150px;">Total Amount</label>
    <input class="cf_inputbox" maxlength="150" size="30" title="" id="text_1" name="L_total" type="text" />
  
  </div>
  <div class="cfclear"> </div>
</div>

<div class="form_item">
  <div class="form_element cf_button">
    <input value="Submit" name="button_3" type="submit" />
  </div>
  <div class="cfclear"> </div>
</div>
GreyHead 25 Aug, 2011
Hi kayrie,

You will need some PHP knowledge to work with ChronoForms like this. Here's a code snippet that you can put in the On Submit Before Email box (make sure that Send Emails is set to Yes on the form General tab or the code will not run).
<?php
$L_cost1 = JRequest::getFloat('L_cost1', 0, 'post');
$L_cost2 = JRequest::getFloat('L_cost2', 0, 'post');
JRequest::setVar('total', $L_cost1 + L_cost2);
?>
This will make the total available in the 'total' result field - use {total} to include it in an email template.

Bob
kayrie 25 Aug, 2011
thank u...
but it only calculate the cost1....
can it made auto-calculate without submitting...
as example : we put it all in html...
so that it appear directly the cost...
GreyHead 25 Aug, 2011
Hi kayrie,

Sorry, you asked for the PHP code so that is what I wrote. You need JavaScript to do the calculation in the browser. You will find many examples in the forums here or using Google.

You will need some JavaScript experience to get this working.

Bob
kayrie 06 Sep, 2011
Hello guys,

Recently i create a form using chronoform and succeed it. The data submitted directly to the database. But i need a help in making a page that will appear 'thank you or else' and the important one the user that insert the data can review back what they submitted and can make changes once again but the changes only certain part only. I know by using chronoconnectivity it will view back the data. But frequently i cannot make it correctly. Need a guide it make it happen.

eg :
1. The user login
2. The menu link show a link registration or review ur data submitted.
3. Registration page let the user submit data like a registration form
4. Review page is when they visit back the website and login then click review it shown they data only (does not review all the other one) but once they submit at first page the contain that they submitted only certain part that can they changes.

Please need your help. Thank you.
GreyHead 06 Sep, 2011
Hi kayrie,

Which version of ChronoForms are you using? You can find the version from Site Admin | Extensions | Install/Uninstall | Components in Joomla! 1.5 or Site Admin | Extensions | Extension Manager | Manage in Joomla! 1.6.

You need the Confirmation Page plug-in/action. It has some known problems in CFv3; in CFv4 it's OK but tricky to configure. Search the forums as there was a useful thread in the last couple of weeks.

Bob
kayrie 08 Sep, 2011
hi bob,

im using choronoform v3....

is is possible to make that happen?
This topic is locked and no more replies can be posted.