Thanks...I will look at your solution.
I am actually hoping to do this client side. I believe I have a good
solution I am coding. I will add an attribute to the dropdown that runs a
java script that takes in the dropdown object, the object that needs
validation, and the values of the dropdown that will cause the validation to
be enabled. Then I will check to see if the dropdown value selected is one
that I will be looking for and then validate the object then. I will then
attempt to attach this to the page submit event.
Thanks for your response though...I did not think of having the dropdown
post back.
"Muhammad Mosa" wrote:
1)Enable your DropDownList Control for AutoPostBack
2)Implement SelectedIndexChanged Event so thet you Enable or Disable your
Required Field Validator according to the value selected from the DropDownList
for example:
if(cmb.SelectedValue =="YourValue")
{
RequiredFieldValidator1.Enabled = true;
}
else
{
RequiredFieldValidator1.Enabled = false;
}
--
Muhammad Mosa
Software Engineer & Solution Developer
MCT/MCSD.NET
MCTS: .Net 2.0 Web Applications
MCTS: .Net 2.0 Windows Applications
"Mike Collins" wrote:
Is it possible to use a required field validator and have it make a user
answer a comment field based on a drop down value picked? For instance, if
the user selects "It was terrible", make them have to enter comments before
allowing that page to be submitted.
If that cannot be done, what is the best way to do this. What makes it
harder is that the questions are being placed on the form from a database
dynamically, so we cannot write any java code ahead of time.
Any replies would be greatly appreciated.