Escort Mileage

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • SandDoller
    Administrator
    • Jul 2025
    • 22

    #1

    Escort Mileage

    In Trip Sheets > Escorts > I have a start odometer and end odometer. Then I have the total mileage for that escort on that trip. That Java code is listed below. I have that in the Add and the Edit pages. Code works great.
    Now for the problem I am having. I want to be able to start the odometer with out putting in the ending reading. If I do that now. I get a nasty number like that escort ran with me the whole time that truck made miles. LOl...
    I need to figure out how to only make that call if the ending odometer is filled in..

    Code:
    // Calculate Odometer values on the fly
    var ctrlStart = Runner.getControl(pageid, 'start_odometer');
    var ctrlEnd = Runner.getControl(pageid, 'end_odometer');
    var ctrlTotal = Runner.getControl(pageid, 'total');
     
    function func() {
      ctrlTotal.setValue(Number(ctrlEnd.getValue()) - Number(ctrlStart.getValue()));
    }
     
    ctrlStart.on('keyup', func);
    ctrlEnd.on('keyup', func);
    //End Calculate
Tandy Services Coding problems

About this Group

This is a place I will have to try to figure out the coding I am working on. Least a list of problems I am having and might come up with a fix.
Type: Public
Topics: 2
Comments: 0

Members (1)

Latest Group Topics

Collapse

Working...