Limit # of times form has been filled out

Permalink
I have a client coming up, that is a dance studio, and she is needing several different contact or in her case registration forms for each class she is going to offer.

What i am going to do is create a contact form for each of her classes but what i am wanting to do is put a limit on the number of times the form can be filled out.

example:
15 spots in a class, if 15 people fill out registration then the form is automatically disabled.

What i am wanting to know is how can i go about doing this easily through the dashboard or code.
thanks