cancel
Showing results for 
Search instead for 
Did you mean: 
fhunth
Nintex Newbie

How to set time portion of date time control in Nintex Forms 2013

If you need to set the default hour and minute values for some date/time controls on a Nintex form, take a look at this using the JavaScript variable option in the Nintex form settings.

In the form date/time control settings, set the property named "Store Client ID in Javascript variable"

In this sample it is named testdate

Then you will need to add this javascript to select the Hour Dropdown and Minutes dropdown. Refer to code snippet below:

NWF$(document).ready(function(){

      var PreTrialHour = 1 + " " + "PM";

      var PreTrialMinute = "30";

      var date = NWF$("#" + testdate);

      var hourddl = date.parent().find("select[id*='DateHours']");

      var minddl = date.parent().find("select[id*='DateMinutes']");

      hourddl.val(PreTrialHour );

      minddl.val(PreTrialMinute);

});

In this snippet, we basically give our DatePicker a 'testdate' javascript variable name. Then on document ready, we set both the hours dropdown and minutes dropdown to our desired values.

This document was generated from the following discussion: Setting time portion of date time control

Labels: (2)
Tags (1)
Reply
1 Reply
Not applicable

Re: How to set time portion of date time control in Nintex Forms 2013

Hi, thank you for the instruction. I followed and got the display time to change to 8 AM. However, when the form's submitted, it always records the time as 8 AM instead of the user's selected time. The user selected a different time when submitting the form, but all the items default and save as 8 AM (js time). Is this happening to anyone else? Did I miss a step in the instruction? Thanks in advance!

0 Kudos
Reply