Validating that a list has at least one member

Topics: Writing modules
Apr 6, 2011 at 6:04 PM

I'm attempting implementing 1:N (where N>0) relationship and was wondering what would be the best way of validating that at creation time. Let me outline the use case:

A market has one or more brochures describing it. When a new market is created, the user has to upload at least one brochure and up to as many as they want.  I'm completely unsure of how to implement both the upload UI and the client/server-side validation to make this work.

Any suggestions?