Prevent form submissions based on value picked

It would be interesting to be able to prevent form submissions if a visitor does not select a specific value within the form, and to display an inline message if these specific conditions are met. 
For instance, if a boolean field in the form is set to true => display message "Sorry, we cannot deal with this kind of request for now"