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

Document created by fhunth Champion on Jul 14, 2015
Version 1Show Document
  • View in full screen mode

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:


      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 );


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

1 person found this helpful