Checkbox form validation

  • 20 February 2015
  • 2 replies
  • 17 views

Badge +2

On my SharePoint Nintex form, I'd like to validate that a checkbox field has been checked when the item is being saved.

Here's my scenario:

- I have a SharePoint list with a Yes/No column "Agreement"

- On the form, I use Custom validation for the control:

ControlSettings.PNG

- My custom validation script checks if the control is checked:

FormSettings.PNG

My issue and question is this:

-- The function always returns the "false" condition, whether the checkbox is checked or not.  The script function is very simple, so I must have the syntax wrong, or am overlooking something basic.  Any suggestions to resolve this would be greatly appreciated!

error.PNG


2 replies

Badge +6

Hi Terri,

On your check box settings, you need to go into advanced settings and select "Store Client ID in Javascript variable".

Then type a new name for a javascript variable - mine here is "vAgreement". Then in your Form Custom javascript, instead of inserting the Reference Agreement, insert vAgreement. (see bottom screenshot)

This should get you out of trouble. Of course the newer versions of Forms have the added ability to apply a Validation rule as you would a Formatting rule. Much easier than playing around with the javascript.

Cheers,

Mark

Badge +2

Hi Mark,

Your resolution worked like a charm!! Thank you!

Terri

Reply