Hello,
I'm looking to see if its possible to have the validation on one item in a form be dependent on another inputs selection.
This scenario loads EquipmentDesigns based on the EquipmentType the user has selected. I would like EquipmentDesigns to be required ONLY if the selected equipment type has equipment designs. In other words, only when the call to get the EquipmentDesigns actually returns data.
I'm looking to see if its possible to have the validation on one item in a form be dependent on another inputs selection.
.
.
.
@(Html.Kendo().Form<EquipmentViewModel>()
.Name("EquipmentForm")
.Layout("grid")
.Items(items =>
{
items.AddGroup()
.Label("Registration Form")
.Items(i =>
{
i.Add()
.Field(f => f.EquipmentType)
.Label(l => l.Text("Equipment Type"))
.Editor(e =>
{
e.DropDownList()
.DataTextField("ShortName")
.DataValueField("EquipmentTypeID")
.OptionLabel("Select")
.DataSource(source =>
{
source
.ServerFiltering(true)
.Read(read => { read.Url("/Equipment/Index?handler=EquipmentTypesByEquipmentClassID").Data("EquipmentClassData"); });
})
.Enable(isControlEnabled)
.Events(e => { e.Change("OnChangeEquipmentTypeChange").DataBound("OnChangeEquipmentTypeChange"); })
.CascadeFrom("EquipmentClass");
});
i.Add()
.Field(f => f.EquipmentDesign)
.Label(l => l.Text("Equipment Design"))
.Editor(e =>
{
e.DropDownList()
.DataTextField("ShortName")
.DataValueField("EquipmentDesignID")
.OptionLabel("Select")
.DataSource(source =>
{
source
.ServerFiltering(true)
.Read(read => { read.Url("/Equipment/Index?handler=EquipmentDesignByEquipmentTypeID").Data("EquipmentTypeData"); });
})
.CascadeFrom("EquipmentType")
.Enable(false)
.Events(e => { e.Change("OnChangeEquipmentDesignChange").DataBound("OnChangeEquipmentDesignChange"); });
});
.
.
.
This scenario loads EquipmentDesigns based on the EquipmentType the user has selected. I would like EquipmentDesigns to be required ONLY if the selected equipment type has equipment designs. In other words, only when the call to get the EquipmentDesigns actually returns data.