I am looking to insert the current military time using javascript that is called from a rich text control in a repeating section. I have gotten this script below to work outside of the nintex form but I am having trouble applying it within the nintex form and having it update the single line of text field.
<script>
function myFunction() { var currentTime = new Date(),
hours = currentTime.getHours(),
minutes = currentTime.getMinutes();
if (minutes < 10) {
minutes = "0" + minutes;
}
if (hours < 10) {
hours = "0" + hours; }
var timeNow = hours + "" + minutes
document.write(timeNow)
}
</script>
Here is what I have currently in the custom Javascript section of the Form Settings but it only seems to refresh the form when clicked (the single line of text control I am trying to update is named TimeL:
function myFunction() { var currentTime = new Date(),
hours = currentTime.getHours(),
minutes = currentTime.getMinutes();
if (minutes < 10) {
minutes = "0" + minutes;
}
if (hours < 10) {
hours = "0" + hours;