I have a form that allows users to enter textbook information for their course. They need to include information such as author, publisher, book title, isbn, etc. They can enter information for more than one book if they choose.

I need to write some code that makes the publisher and book title fields required...but ONLY if they choose to add a first, second, third book.

I guess what I'm looking for is some help on how to create required fields that are dependent on some other field being selected/checked.