How to execute client script before auto submition

I enabled auto attendance via biometric integration to mark attendance . In attendance i created two custom fields for ot, ot is calculated from the working_hours field by client script. Now if i generate attendance, the record is submitted first then the ot is updated so i cant save the updated field as it is submitted. But i want ot to be calculated first and then it should get submitted.