When calling the below JavaScript method, the first alert is printed. Not even "Before return" alert is printed. Only if I do an F12, then the other alerts are shown. Please suggest!
function validateFPNotes() {
var message = "";
var notesId = document.getElementById('FANManagementForm:FANNotesTextIp');
alert("validateFPNotes called and the notesid is :" + notesId);
if (notesId != null) {
alert("Not Null Block");
var notesVal = trimString(notesId.value);
alert("Notes Val:" + notesVal);
window.console.log("validateFPNotes::notesId.value = " + notesId.value);
alert("doc.getEletById(maxLengthNotes)" + document.getElementById(maxLengthNotes));
var maxLength = document.getElementById(maxLengthNotes).value;
alert("maxLength is:" + maxLength);
if (notesVal != null && notesVal.length > maxLength) {
message = message + replaceMaxLengthMessageTokens(document.getElementById(maxLengthExceedMessage).value, 'Notes', maxLength);
alert("Message :" + message);
} else {
alert("Null Block");
window.console.log("validateFPNotes::notesId.value = " + notesId.value);
}
if (message.length > 1) {
alert(message);
return false;
}
} else {
alert("Null Block");
}
alert("Before return");
return true;
}