Jump to content

need help on 'BeforeFormSubmit' event

Recommended Posts

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


Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...