Validation rules not firing Javascript error

  • 21 February 2017
  • 5 replies
  • 15 views

Badge +3

I can't get a validation rule to run on a form I am working on. There is a javascript error being shown in the Javascript console, but I am not running any javascript on the form. I do have about 40 formatting rules and they seem to work, but when I add a validation rule and it is supposed to be evaluated I get

199712_pastedImage_1.png

The validation rule is simple. All I am donig for this one is isNullorEmpty({Self}) on a text box. but because of the javascript error it is not fireing.

I read about the latest issue with list item forms not firing validation because the validation needs to be on the content type form, but I am not sure that applies here. I am running version 9.2.20 and the list doesn't allow management of content types.

Any help on this would be much appreciated. Also please let me know if you think I should try opening a support case.

Thanks, Berney


5 replies

Badge +3

Hey community manager. I am not sure why this question is assumed answered. I just posted it so it has not been answered. Can you wave your magic wand and mark it as unanswered?

Berney

Userlevel 5
Badge +14

this error doesn't come from validation rule but rather from custom validation (that's the one you can configure in control's setting dialog).

if you hover mouse over 'val.clientvalidationfunction' code on highlighted line you should see content you put into validation function input box. you must have to put something there that breaks javascript syntax.

Badge +3

When I look at that variable I get "isNullOrEmpty({Control:59be5a02-0b14-43e2-8bbc-dd19e68bccc3})" That looks like the validation rule I put on the textbox.... isNullOrEmpty({self}), but I don't see the error. Am I missing something?

Userlevel 5
Badge +14

it might as well be that you miss or have one extra coma, bracket, apostrophe etc. somewhere, that breaks code structure/syntax and error is simply reported on another place.

other possible reason is that you have some of such characters in validated data, and if you did not correctly escaped them or enclosed them into apostrophes and/or {TestStart}/{TextEnd} tags, they cause problems.

it's hard to investigate, you will have to go through all formulas and custom code to proofcheck syntax is correct and they are not sensitive to special characters in data

Badge +3

The issue was with one custom validator I didn't even realize was on the form. I deleted and recreated all controls on the form to make sure they were clean and thus stumbled on one I didn't realize was there. Once cleaned all worked as expected. 

Reply