Make forced field dependent on choice on another


I've got two custom properties (both dropdowns) in my page type and I'd like to make the second one forced (value must be entered) if a certain value is selected in the first one. Any ideas on how to do this?

Aug 18, 2011 15:51

Easiest would be to create a custom property that uses both of these custom properties and add the necessary validation logic based on that. Another approach is using FindControl method to find the other property and inject the necessary validation based on the value (could also use PropertySettings for this).

Hope this helps.


Aug 18, 2011 16:33

I need to be able to use them seperately so perhaps the FindControl would be the easiest way to do it then. Thanks!

Aug 18, 2011 16:35

Here is a post about validation in custom properties:, might be easier for you to hook into the Save page event and add the validation logic there (see for an example).

Good luck!


Aug 18, 2011 16:44

That save page event was great advice. Thank you!!

Aug 19, 2011 9:56
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.