This Error will happen whenever there is an error in the javascript code (
syntax error or run time error )
If there is an error (
Syntax or run time
), and if unhanded it will return as
true
.
Try to do check the below :
Place a
debugger
in the first line of your
javascript function
function checkRequiredFields() {
debugger;
var imgpath = document.getElementById('FileUpload1').value;
To debug you can either use Chrome browser or IE by Enabling the Developer Tools, which can be done by
- Chrome- Open the developer tools by pressing F12 or Menu->Tools (More tools) -> Developer tools
- IE
- Press F12
Try to hit the function by some event ( say button click ). now you can debug
line by line to Find where the exception has been raised.
The error will be displayed in the
Console
Tab of the Developer Tools window.