with the commit
40342aa6c4278497b9ec8c9cce8739f9b29c2e8f
we introduced a validator on the guestidselector, but did not
notice that the wizard checks the validity on the field change event,
but the selector gets valid/invalid in an api callback(so a little later)
with this patch, we now validate the field correctly with validate()
and also listen on the validitychange event to catch it
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
value < me.minValue ||
value > me.maxValue) {
// check is done by ExtJS
- return;
+ return true;
}
if (me.validateExists === true && !me.exists) {
method: 'GET',
success: function(response, opts) {
me.exists = false;
- me.isValid();
+ me.validate();
},
failure: function(response, opts) {
me.exists = true;
- me.isValid();
+ me.validate();
}
});
}
display_header(tabs[0]);
Ext.Array.each(me.query('field'), function(field) {
- field.on('change', function(f) {
+ var validcheck = function() {
var tp = me.down('#wizcontent');
var atab = tp.getActiveTab();
var valid = check_card(atab);
} else if (ntab && !atab.onSubmit) {
ntab.enable();
}
- });
+ };
+ field.on('change', validcheck);
+ field.on('validitychange', validcheck);
});
}
});