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..
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