这是我的模特:
Primary
{
public Boolean Yes { get; set; }
public Boolean NoHome { get; set; }
public int mailzip
public string mailcity
public string mailstate
}
我有两个字段,根据这两个字段,必须在文本框上对注释进行必要的字段验证
其中一个是复选框(激活->
必填字段的条件必须检查)
@Html.CheckBoxFor(model => model.nohome, new { name = "NoHome", id = "NoHome" })
OR
另一个是@Html.RadioButtonFor pair
- 必须单击以下内容才能验证必填字段
@Html.RadioButtonFor(model => model.primary.yes, "true", new { name = "DifferentAddress", id = "DifferentAddressYes" })
@Html.RadioButtonFor(model => model.primary.no, "true", new { name = "DifferentAddress", id = "DifferentAddressYes" })
以上两个字段中的任何一个都应该能够在以下3个字段中触发所需的字段属性
mailzip
mailcity
mailstate