I have a multi line column named "Business Justification". I have to validate it to show whether it is empty or not.

 if($('nobr:contains("Business Justification")').closest('tr').find('.ms-rtestate-write').val()== "")

            alert('provide business justification');
            return false;}

I used the above code but this gives the alert message even if value is given


Use below:

var content=$("nobr:contains('Field Name')").parent().parent().parent().find("div.ms-inputBox div.ms-rtestate-write").text()
if (content.trim() == "")  

Replace the 'Field Name' token with column display name

  • the if condition doesnt work ......the value is still saved when the textbox in empty – sweta Nayak Mar 27 '18 at 11:55
  • Please share the MLT type- Enhanced rich or rich text box in SharePoint – Deepmala Mar 28 '18 at 3:54
  • its enhanced rich text – sweta Nayak Mar 28 '18 at 4:20
  • Try to log the value. There could be some hidden html tags in the textbox – Deepmala Mar 28 '18 at 4:39

Please try using the below code instead

     alert('provide business justification');
                return false;
     return true;

try and feedback

  • this is not working – sweta Nayak Mar 28 '18 at 4:19

Try to make Business Justification mandatory.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.