I am currently validating a textarea
using the NicEdit plugin.
var getContent = nicEditors.findEditor("SubSliderDescription").getContent();
bValid = bValid && checkBlankTextArea(getContent, "SubSliderDescription")
function checkBlankTextArea(o, n) {
if (o == "<br>" || o == null) {
// Add a class to the textarea to display validation errors
// o.addClass("ui-state-error");
updateTips(n + " is required.");
return false;
} else {
// o.removeClass("ui-state-error");
return true;
}
}
If the validation fails, the Nic Editor should apply the ui-state-error
class (which adds a red border to the control), otherwise it should not.
However, I am encountering an error in the script that says the methods addClass or removeClass cannot be applied.
Is there any solution to this issue?