Hide add to cart/buy button unless customer fill in/upload a form

Hi,

Is there a way to hide or disallow customers to add items to cart unless they fill in the form supplied and/or upload a file ? Basically to add a ‘rule’ for customers to add specific products to cart. Some products they don’t need to fill in a form but some do.

Alternatively, if none of the above is possible. Is there a way to force customers to fill in a form/upload a file before checking out IF they have some restricted products (requires filling in a form) among their cart items ?

Thanks