0

I am using this code to validate the Combobox in IE6, this is not working.

In Firefox and Chrome its working. PLease suggest me some way to validate the Combobox in IE6.

Code:

xtype: 'combo',
            fieldLabel: 'Label',
            anchor: '100%',
            allowBlank: false,
            displayField: 'value',
            store: 'level1Store',
            lazyInit: false,
            mode: 'local',
            forceSelection: true,
            disableKeyFilter: true,
            editable: true,
            selectOnFocus: true,
            triggerAction: 'all',
            valueField: 'key',
            name: 1,
            ref: 'combo1',
            id: 'field1',
            validator: function(value){
                var temp = 0;
                for(var i=0;i<value.length;i++){
                    if(value[i]=="?"){
                        temp = temp + 1;
                    }
                }
                if(temp >3){
                    return false;
                }else{
                    return true;
                }
            }
        }

Thanks

Raj

user27
  • 274
  • 9
  • 26
  • Does the validator() get called? If you put some trace inside the function - you should be able to see if it gets called. Also - is there any JS errors in the console? – sha Apr 16 '12 at 15:55

1 Answers1

0
validator: function(value){
            var arr = value.split("?");
            if(arr.length >4) {
                return false;
            }else {
                return true;
            }
        }

This is working fine.

user27
  • 274
  • 9
  • 26