I need a validation on my TextArea so my TextArea do not contain a specific special character such as ” | ” only.
I was trying something like this:
$('#CustomButton').click(function () {
if $("#CustomQuestionText").val()).indexOf('|') > -1)
{
alert("The box has special characters. \nThese are not allowed.\n");
}
else
{
my code here..
}
Any solutions is appreciated.
Thanks in advance
try this