Don't complain about read-only required fields

This commit is contained in:
Nathan Gray 2013-07-10 18:25:28 +00:00
parent da35098e08
commit 4e947b304c

View File

@ -165,7 +165,7 @@ var et2_inputWidget = et2_valueWidget.extend([et2_IInput,et2_ISubmitListener],
var node = this.getInputNode(); var node = this.getInputNode();
if (node) if (node)
{ {
if(_value) { if(_value && !this.options.readonly) {
$j(node).attr("required", "required"); $j(node).attr("required", "required");
} else { } else {
node.removeAttribute("required"); node.removeAttribute("required");
@ -243,7 +243,7 @@ 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.needed && (this.getValue() == null || this.getValue().valueOf() == '')) if(this.options.needed && !this.options.readonly && (this.getValue() == null || this.getValue().valueOf() == ''))
{ {
messages.push(this.egw().lang('input required')); messages.push(this.egw().lang('input required'));
ok = false; ok = false;