979
Views
8
Comments
Solved
An exception occurred in the client script. Error: Cannot set property...
Question

I have to say that sometimes the exception error reporting has a lot to be desired:

"An exception occurred in the client script. Error: Cannot set property 'elementsToValidate' of null"

Could someone explain what has happened here and try to point me in the right direction to solving this.

Regards,

Chris.

Staff
Rank: #58
Solution

That's an error executing JavaScript, apparently in some sort of form validation. Maybe you have some validation implemented that's referring to an element that's not present in the page.

mvp_badge
MVP
Rank: #5

Hello Christopher,

This is a browser error related to a NULL object that was being used.
Without knowing what are you doing, and how are your page and code, will be almost impossible to help you.

Cheers.

Rank: #10001

Thank you.  I seem to have sorted it out.    I still find the exception messages hard to understand!!!

mvp_badge
MVP
Rank: #5

Hi Christopher,

They are hard to understand, even for people that have a lot of experience.
We end up being used to them, but they can be hard to understand the first time.

By the way, what was the cause of the error? :)

Cheers.

Staff
Rank: #58
Solution

That's an error executing JavaScript, apparently in some sort of form validation. Maybe you have some validation implemented that's referring to an element that's not present in the page.

Rank: #10001

Not entirely sure.  I am doing a lot of work with anonymous users adding data to a form and then that same user coming back to add more data to the existing form  It was something to do with a validation but have not had it happen again.  Thank you for your time, much appreciated.

Regards,


Chris.

Rank: #1877

If you are refreshing a widget using "Ajax Refresh" which is not rendered on page (might be due to if/else condition). That time you may see this error.

Rank: #77793

Hi Christopher White

"An exception occurred in the client script. Error: Cannot set property 'elementsToValidate' of null"


I was receiving the same error.

I found my issue was that I was running an ajax refresh on a form.
But for that step the form section was skipped. SO when I ajax refreshed.

The form had no data to submit and when I ajax refreshed the form. I received the error.
I corrected my ajax refresh to refresh a container and my error went away.
This way I removed the extra I didn't need.