如何让ext.net RadioGroup成为必填字段?

时间:2013-09-24 17:56:33

标签: ext.net

我们正在使用ext.net。我知道如何使文本框成为必填字段,但是很难强迫我们的用户在无线电组或复选框组中进行选择。我知道有人只是给一个单选按钮分配一个默认值,但是我们的客户希望在开始时不加以控制,但强制网络用户做出选择,这是可以理解的。

即使它们列在IntelliSense中,IndicatorTextAllowBlank属性也无效。

<ext:RadioGroup ID="rdGrpGender" runat="server" 
      ItemCls="x-check-group-base" FieldLabel="Gender"
      ColumnsWidths="60,60" 
      IndicatorText="*" IndicatorCls="cssIndicator" AllowBlank="false">
      <Items>
          <ext:Radio ID="rdoMale" runat="server" BoxLabel="M" />
          <ext:Radio ID="rdoFemale" runat="server" BoxLabel="F" />
      </Items>
</ext:RadioGroup>

任何专家都可以帮助我吗?非常感谢。

1 个答案:

答案 0 :(得分:0)

你可以像这样验证它

    <ext:Button ID="Button1" runat="server" Text="Validate"><Listeners><Click Handler="#{rdGrpGender}.validate();" /></Listeners></ext:Button>