Limit form submission to a certain number

This would solve a problem for our organization as well. We desire to limit the number of submissions on a seminar training form on our landing pages. Ideally, it would limit based on which page it’s placed on. We only have 40 spots so it would be great to have the form disable after 40 submissions on that page and note “class is full.” Thanks!