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

Validation on Date only control that setted value via JS not works

If you put a Date/Time control that is "Date Only", on a form, and set its value via this code:

 

NWF$(function(){
	NWF$("#" + d3).val("01/01/2016");
});

Then add a validation rule on this control to prevent a blank date:

 

 

isNullOrEmpty({Self})

the validation rule will not undrestand its value, and show validation error message.

 

Now, if you set "Date Only" drop down to "No" on contorl settings dialog, this problem does not occure.

Why?

Labels: (1)
0 Kudos
Reply
3 Replies
Automation Master
Automation Master

Re: Validation on Date only control that setted value via JS not works

what env do you experience this in?

I can not reproduce it on my end (NF2013 v2.11.5.0)

 

anyway, it would be better to set control's value(s) within RegisterAfterReady event.

see - https://community.nintex.com/t5/Nintex-for-SharePoint/JavaScript-events-in-Nintex-Forms/m-p/83914 

0 Kudos
Reply
mrahda2
Nintex Newbie

Re: Validation on Date only control that setted value via JS not works

Nintex Forms 2013 ( 2.11.4.0 )

Use "RegisterAfterReqady Event" will not resolve my problem.

Becaus my orginal problem is that:

Setting Date Only control's value via JS, will not affect in IsNullOrEmpty function!

 

0 Kudos
Reply
Automation Master
Automation Master

Re: Validation on Date only control that setted value via JS not works

have you checked you're not getting errors reported on developer console?

 

 

can you post how does following evaluates on developer console for both DateOnly and Date&Time scenarios?

 

NWF.FormFiller.Functions.GetValue(NWF$("#" + d3).attr('formcontrolid'));
NWF.RuntimeFunctions.isNullOrEmpty(NWF.FormFiller.Functions.GetValue(NWF$("#" + d3).attr('formcontrolid')));
0 Kudos
Reply