No you can't. PHP is server side and therefore won't be able to detect anything on the client side until it is told to process a request. (i.e. when someone clicks a form button).
Any ways in which you try to put this in place can be quickly circumvented. For example I can just Disable JS while visiting your forum and have free-reign over the content. (4 clicks...to be precise

)