如果是条件,C#Listener中的Javascript

时间:2018-02-22 09:55:45

标签: javascript c# extjs ext.net

我有这个组合框:

<ext:ComboBox ID="PhonePrefix" runat="server" Width="470" Editable="false" FieldLabel="Phone prefix" Mode="Local" AllowBlank=false  HideTrigger="true" EmptyText="Country">
      <Items>
           <ext:ListItem Text="Greece (+30)" Value="+30"  />
           <ext:ListItem Text="France (+33)" Value="+33" />
           <ext:ListItem Text="Germany (+49)" Value="+49" />
           <ext:ListItem Text="Italy (+39)" Value="+39" />
           <ext:ListItem Text="Jordan (+962)" Value="+962" />
           <ext:ListItem Text="Lebanon (+961)" Value="+961" />
           <ext:ListItem Text="Saudi Arabia (+966)" Value="+966" />
           <ext:ListItem Text="United Kingdom (+44)" Value="+44" />  
           <ext:ListItem Text="United States (+1)" Value="+1" />     
      </Items>
      <SelectedItems>
           <ext:ListItem Index="0" />
      </SelectedItems>  
      <Listeners>
         <Change Handler="if(this.value.length == 4)
                               #{txtSiteAddDoctorMobile}.minLength = 9;
                        //else
                             //#{txtSiteAddDoctorMobile}.minLength = 10;
          " />
      </Listeners>   
</ext:ComboBox>

使用监听器我想改变文本字段的minLength。像这样代码可以工作但是当我取消注释else语句时,我得到了js错误:

  

a.getData不是函数

     

无法设置未定义的属性'minLength'

     

l.getCount不是函数

     

无法读取未定义的属性'dom'

0 个答案:

没有答案