I am looking for a way to capture the time once a signature is signed via signature field. I used the code found here to do this and manipulated it to watch the 'Sign' button found in the signature display (See code below), but now I'm looking to accomplish this with multiple signatures on a page. I found that the 'Sign' Button has a class of "btn btn-primary signature-btn signSignatureBtn" but if I sign the form using the 2nd signature field, it applies a new time stamp to the original field(timeIn). Any ideas on how to differentiate between the two buttons signature fields? The use case is for a shipping document - The shipper needs to sign upon arrival (timeIn) and the carrier needs to sign upon departure (timeOut).
//Sign-Time $(document).ready(function () { $('.signSignatureBtn').click(timestamp); function timestamp() { var d = new Date(); var minutes = d.getMinutes(); if (minutes < 10) {var minutes = "0" + minutes;} if (d.getHours() < 12) { var a = "AM";} else {var a = "PM";} if ($(this).hasClass('signSignatureBtn')) { $('.timeIn input').val(d.getHours() + ":" + minutes + a); } else { $('.timeOut input').val(d.getHours() + ":" + minutes + a) } } }); //End Sign time