Custom Validation in Nintex Forms 2013 not working

  • 12 January 2015
  • 3 replies
  • 4 views

Badge +3

Hi,

I have upgraded the Nintex forms 2010 to Nintex Forms 2013 while upgrading our Sharepoint 2010 environment to SharePoint 2013.

There were Required Field Columns hidden from the view which will not get validated as they are hiddne. After moving to Nintex 2013, the hidden fields started throwing form required validation errors.

I read somewhere that the Nintex Forms 2013 has changed and it would not be an option to have a hidden field in the form and skip required field validation.

So I removed the required option from the SharePoint list and wrote a custom validation function which is mentioned below.

So when Edit Mode the Custom Validation fired and did not show the custom validation message. it actually closed the form instead of staying in the form. Kindly help as soon as possible,

I was expecting that the arguments.IsValid = false; will have the form stay and show the custom validation error messge, but it closed the form.

Can somebody help to what needs to be done in the below script to have the form stay and show the custom error message ?

function mustNotBeBlank(source, arguments)

{

     var strModeEdit = "Is Edit Mode";

       if (strModeEdit.toLowerCase() == "true")

       {

              arguments.IsValid=true;

              var titleText = arguments.Value;

              if (titleText == "")

              {

                   arguments.IsValid=false;

                    alert("Please Enter Closure Date");

               }

         }

}

Thanks,

Senthil Kumaresan.


3 replies

Badge +3

Senthil-

Were you ever able to resolve this issue? I have some custom validation I am doing on the "Save and Submit" button. The error is trapped and I set arguments.IsValid = false but the form closes if there are no other invalid items.

Mike Trouard

Badge +9

Looks like a Javascript error. What says debugging console?

Badge +2

Instead of removing the field and using custom javascript, you can resolve this "hidden" issue if you set instead of a rule the visible setting in "control settings->appearance-->visible->expression". Here you can use an expression to hide the field. The required field will not be validated and you can use the form without any custom JavaScript. This works fine in Nintex Forms 2013.

Reply