当前位置: 代码迷 >> Web前端 >> Ext 解决文本框 输入空格 交付按钮还是灰色
  详细解决方案

Ext 解决文本框 输入空格 交付按钮还是灰色

热度:64   发布时间:2012-10-26 10:30:59.0
Ext 解决文本框 输入空格 提交按钮还是灰色

??????? <script type="text/javascript">
Ext.onReady(function(){
?Ext.QuickTips.init();
??? Ext.form.Field.prototype.msgTarget = 'side';// 提示的方式,枚举值为"qtip","title","under","side",?

?function notNull(text){
?????? ? if(this.allowBlank==false && Ext.util.Format.trim(text).length==0){
???????????? ?return false;??????
????? ? }else{???????
??????????? ?return true;
?????? }
?}

??? var form = new Ext.form.FormPanel({
??????? defaultType: 'textfield',
??????? labelAlign: 'right',
??????? title: 'form',
??????? labelWidth: 50,
??????? frame:true,
??????? width: 220,
??????? monitorValid:true,
??????? items: [{
??????????? fieldLabel: '文本框',
?????????? ?allowBlank:false,
??????????? blankText:"该项必须输入",
??????????? invalidText :"该项必须输入",
?????????? ?validator:notNull
??????? }],
??????? buttons: [{
??????????? text: '提交',

??????????? formBind:true,
??????????? handler: function() {
?????????????????????????? ?alert("即将提交");
??????? ????? });
??????????? }
??????? }]
??? });
??? form.render("form");

});
??????? </script>
??? </head>
??? <body>
??????? <div id="form"></div>
??? </body>
</html>

1 楼 sddwmm 2010-05-31  
你这样台麻烦了
2 楼 babydeed 2010-05-31  
sddwmm 写道
你这样台麻烦了

有何简单方法 请说一下
  相关解决方案