Jump to content

Chakkra

Members
  • Content Count

    1
  • Joined

  • Last visited

About Chakkra

  • Rank
    Newbie

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. I want to achieve this simple calculation (below) in my details page. This is where the user enters new lab_fee and the update should take place for the value of TotalFee. It should automaticcally display the value before i hit the Update button on the details page. .... var v1 = document.getElementById("EditRecordlab_fee").value; var v2 = document.getElementById("EditRecordc_discount").value; var v3 = document.getElementById("EditRecordcredit_charge").value; var v4 = v2 + v3 - v1; document.getElementById("EditRecordTotalFee").value = Round(v4,2); .... According to Caspio Bridge 13.0, it was suggested that the below javascript could do the job. i guess for my case i have to put some codes in the //do somethig. Or I might be wrong. Can anyone kindly help me on this? <script type="text/javascript"> document.addEventListener('BeforeFormSubmit', function (event) { // do something }); </script>
  2. hi Maymusic:)

    i wish you could have time to look at this for me please. I want to be able to edit some fields in th search result details page.

    here are my codes. There are some calculations that i want to achieve too. i am not sure about the syntaxs of my code. Note, all values are number.

    your kind assistanc is highly appreciated.  

    <SCRIPT LANGUAGE="JavaScript">
     
    function calculate()
    {
    var v1 = document.getElementById("EditRecordlab_fee").value;
    var v3 = document.getElementById("EditRecordc_discount").value;
    var v4 = document.getElementById("EditRecordcredit_charge").value;
    var v7 = document.getElementById("EditRecordField1").value;
    var v8 = document.getElementById("EditRecordXray_sum").value;
    var v9 = document.getElementById("EditRecordBleachValue").value;
    var v11 = document.getElementById("EditRecordXray").value;
     
    var v5 =  V3+V4-V1;
    var v6 = v5*v7;
    var v10 = v6+v8+v9;
    var v12 = v11*30;
     
    document.getElementById("EditRecordTotalFee").value = v5;
    document.getElementById("EditRecorddf").value = v6;
    document.getElementById("EditRecordpay_df").value = v10;
    document.getElementById("EditRecordXray_sum").value = v12;
     
    }
     
    document.getElementById("caspioform").onchange =calculate;
    </SCRIPT>

    1. MayMusic

      MayMusic

      You do not need to have script in this case, for all the fields that are holding the calculation values select Calculated Value as form element in the details page and from the picker select the fields to do the calculations for instance:

       

      TotalFee  would be a Calculated Value and the formula is:

      [@field:c_discount] + [@field: credit_charge]  - [@field: lab_fee]

       

       

×
×
  • Create New...