PDA

View Full Version : Combobox with forceSelection and validationEvent



tgeber
1 Dec 2009, 11:29 AM
Hello,

I try to use a combo box, in which pre-defined values and individual entries will be possible.

For this reason I use forceSelection:false.

I also want to perform the validation for this combo box only when sending the form, why I do configure validationEvent: false

validationEvent: false seams only to work if forceSelection: true is set. Is this a bug?

What can I do?

Regards,
Thomas

I am using ExtJs version 3.0.3

husniadil
1 Dec 2009, 12:32 PM
try adding this config options into your ComboBox:


listeners: {
invalid: function(o) {
o.clearInvalid();
}

tgeber
1 Dec 2009, 12:44 PM
This is good, but the combobox is now no longer marked as invalid when I Send the form.
Do you have a solution for this too?

Regards,
Thomas

husniadil
1 Dec 2009, 1:26 PM
Okay...

let's change the code:

listeners on ComboBox


listeners: {
change: function(o) {
o.clearInvalid();
},
select: function(o) {
o.clearInvalid();
},
blur: function(o) {
o.clearInvalid();
}
}

validation before submitting form


if (combo.isValid() === false) {
combo.markInvalid();
`}

tgeber
1 Dec 2009, 1:44 PM
great work. The problem is solved :-)

Thank You very much