I have a simple enough javascript function which checks if text exceeds limit if certain placeholder is added.:-
function updateText(){
var selecnotificationplaceholder = document.getElementById('mainFrom:selecnotificationplaceholder');
var notificationTextTxt = document.getElementById('mainFrom:notificationTextTxt');
var resultedLength = notificationTextTxt.value.length + selecnotificationplaceholder.value.length;
if (resultedLength <= 5) {
alert("To be added");
}
else {
alert("Could not be added");
}
}
But I get this parsing error when loading the page on the line
if (resultedLength <= 5) {