- Posts: 18
- Thank you received: 0
Ask the community, share ideas, and connect with other LimeSurvey users!
Please Log in to join the conversation.
<div id="buttonplacement"> <button id="tapbutton" type="button">TAP</button> </div>
<script type="text/javascript" data-author="Tony Partner"> $(document).on('ready pjax:scriptcomplete',function(){ // Identify this question var thisQuestion = $('#question{QID}'); var thisTextarea = $('input[type=text]:eq(0)', thisQuestion); var thisCountarea = $('input[type=text]:eq(1)', thisQuestion); var timestamps = []; if($.trim($(thisTextarea).val()) != '') { timestamps = $.trim($(thisTextarea).val()),split(','); } // Listener on the button $('#tapbutton').on('click', function(e) { var newTimeStamp = Date.now(); timestamps.push(newTimeStamp); $(thisCountarea).val(timestamps.length); $(thisTextarea).val(timestamps).trigger('keyup'); }); }); </script>
<style type="text/css">#question{QID} .answer-container { display: none; } #buttonplacement { text-align: center; } </style>
Please Log in to join the conversation.