there should be no validation for disabled widgets

This commit is contained in:
Ralf Becker 2015-03-17 22:00:54 +00:00
parent 2cee8df131
commit 41671d733a
4 changed files with 7 additions and 5 deletions

View File

@ -296,7 +296,8 @@ var et2_inputWidget = et2_valueWidget.extend([et2_IInput,et2_ISubmitListener],
var ok = true; var ok = true;
// Check for required // Check for required
if(this.options && this.options.needed && !this.options.readonly && (this.getValue() == null || this.getValue().valueOf() == '')) if (this.options && this.options.needed && !this.options.readonly && !this.disabled &&
(this.getValue() == null || this.getValue().valueOf() == ''))
{ {
messages.push(this.egw().lang('Field must not be empty !!!')); messages.push(this.egw().lang('Field must not be empty !!!'));
ok = false; ok = false;

View File

@ -143,7 +143,8 @@ var et2_radiobox = et2_inputWidget.extend(
var ok = true; var ok = true;
// Check for required // Check for required
if(this.options && this.options.needed && !this.options.readonly && (this.getValue() == null || this.getValue().valueOf() == '')) if (this.options && this.options.needed && !this.options.readonly && !this.disabled &&
(this.getValue() == null || this.getValue().valueOf() == ''))
{ {
if(jQuery.isEmptyObject(this.getInstanceManager().getValues(this.getInstanceManager().widgetContainer)[this.id.replace('[]', '')])) if(jQuery.isEmptyObject(this.getInstanceManager().getValues(this.getInstanceManager().widgetContainer)[this.id.replace('[]', '')]))
{ {

View File

@ -120,7 +120,7 @@ var et2_template = et2_DOMWidget.extend(
} }
// Read the XML structure of the requested template // Read the XML structure of the requested template
this.loadFromXML(templates[template_name]); if (typeof templates[template_name] != 'undefined') this.loadFromXML(templates[template_name]);
// Update flag // Update flag
this.loading.resolve(); this.loading.resolve();

View File

@ -154,7 +154,7 @@ var et2_textbox = et2_inputWidget.extend([et2_IResizeable],
{ {
var ok = true; var ok = true;
// Check input is valid // Check input is valid
if(this.options && this.options.validator && !this.options.readonly) if(this.options && this.options.validator && !this.options.readonly && !this.disabled)
{ {
if (typeof this.options.validator == 'string') if (typeof this.options.validator == 'string')
{ {