I'm writing a form that was supposed to use conditional validation,
something I found to be too expensive or too time consuming to be
feasible. Instead, I'm using a multi-page form to do the same thing. I
need to turn off certain form elements and their validation based on
what a user selects on the previous form, which can be a combination of
three things: Mail, Email, or Download. (Don't ask me why they would
need something emailed and downloaded. It's what the client is asking
for.)
The user is required to submit their name (first and last) for
everything. If they select Mail, they need to enter their address which
is validated using ASP.NET's validation and UPS address validation (for
which I've written a class). If they select email, they are required to
enter their email address.
In PHP, I would just display these form elements on the fly using if
statements. But since you're not supposed to do that in ASP.NET, I need
a way to display these elements on the page, with their validation,
without resorting to creating seven different forms and redirecting to
them based on the selections of the user.
I can try to talk to the client to allow only one selection instead of
the combination, but I still don't know how to get around making three
or more seperate web forms to handle the conditional validation
requirements.
If this is too obscure I'll try to post more details and examples tomorrow.