This topic is locked

javascript calculate time on fly

11/21/2017 3:27:14 PM
PHPRunner General questions
A
alfe author

Hello

I need to calculate a duration between an hour of departure and an hour of return day by day (mission on the ground with a boat). I found this (http://asprunner.com/forums/topic/24265-different-in-hour-and-minutes-javascript-onload/pagehlcalculate%20hourfromsearch1) and it's running quite good with javascript on fly. Staying in the add page, I need to use this total calculated on an another page (I use a tab) and while the record is not saved, it's not recorded in the database.

My goal is to pass the value calculated on the first tab to the 2nd tab and also on the 3rd tab. Then I need to use it to spread time between differents activities and deducted the time from the total until it's equal to 0

PS : sorry for my bad english...

admin 11/22/2017

This article explains how to calculate a value on the fly and store it in another field:

https://xlinesoft.com/phprunner/docs/how_to_calculate_values_on_the_fly.htm

A
alfe author 11/22/2017

Thanks for your answer but I already saw this article and use it. My question is that while the record is not saved, the value calculated is not saved in the database. I have several tab where I need to use this total and I would like to know how can I use it in the different tab ? Thanks

admin 11/24/2017

This is exactly how you can use in a different tab. This code will works with fields that are spread across different tabs.