I have the JavaScript for inserting a timestamp upon a click. We are using the survey for an audit and need to have auditor click the time they start each task. I do not want to use time began survey, as I need multiple timing fields for different actions. The JavaScript I have when I copy it to a new question , once I test it, it populates into the one below, and it won't populate more than once.
I know there is something wrong with the code but I am not sure what.
Solved
Insert a timestamp on click
Best answer by rondev
Create a text entry form field question with 1 field. In the click to write statement for field 1 paste the below code:
In the JS onReady function of the same question paste the below code:
var that =this;
jQuery("#"+that.questionId+" .InputText").attr("readonly",true);
jQuery("#"+that.questionId+" #button").on('click',function(){
jQuery("#"+that.questionId+" .InputText").val(new Date());
});
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
