I have a form where the form elements are grouped in several divs.
Depending on user choices certain divs will display and others will have display:none.

I want some fields to be required but only when the surrounding div has the value display: block.

Is there a way to do this?

It is possible, please show us what code you have for now with some more explained info of exactly what is required. Current question is very general.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.