It is possible to achieve similar solution to this. There are two ways to achieve it. First one is to change the validation group of the text box each time you change the selection of the dropdown list. Which means to reload the page on each change. The other way is much more optimized you just check which element of the drop down is selected and validate the textbox according to it.
In order to do it you need to create a custom Form that inherits from FormsControl.
Handle BeforeFormSave event and check form`s fields. This event is cancelable and if your requirements are not satisfied you can cancel form submission and display an error message.
A sample code for this:
void MyForm_BeforeFormSave(object sender, System.ComponentModel.CancelEventArgs e)
var isRequired = false;
var isEmpty = false;
var fieldControls = ((MyForm)(sender)).FieldControls;
foreach (var fieldControl in fieldControls)
if (fieldControl is FormDropDownList)
var choices = (FormDropDownList)fieldControl;
if (choices.Value.ToString() == "Phone")
isRequired = true;
if (fieldControl is FormTextBox)
var textBox = (FormTextBox)fieldControl;
string text = textBox.Value.ToString();
if (text.Length == 0)
isEmpty = true;
if(isEmpty && isRequired)
((MyForm)sender).ErrorsPanel.Visible = true;
((MyForm)sender).ErrorsPanel.GroupingText = "This is a required field!";
e.Cancel = true;
My form declaration contains TextBox, Dropdown list and submit button.
All the best,
the Telerik team
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking
system and vote to affect the priority of the items