Accessing Comments in Java

I need to prevent a record from saving unless a comment has been made, i would like the comments to be inserted in the proper comment section (on the bottom right-hand corner) but so far i can’t seem to create a logic to check whether or not a comment has been made.

Basically, what i want is to access the comments via javascript and simply check whether a comment has been made, if yes, let the record be saved, if no, then prevent the record from being saved.