From 4e947b304cdfcca37f7735e4c72481e64457e7f5 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Wed, 10 Jul 2013 18:25:28 +0000 Subject: [PATCH] Don't complain about read-only required fields --- etemplate/js/et2_core_inputWidget.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/etemplate/js/et2_core_inputWidget.js b/etemplate/js/et2_core_inputWidget.js index 632f201e79..53e7bd3a77 100644 --- a/etemplate/js/et2_core_inputWidget.js +++ b/etemplate/js/et2_core_inputWidget.js @@ -165,7 +165,7 @@ var et2_inputWidget = et2_valueWidget.extend([et2_IInput,et2_ISubmitListener], var node = this.getInputNode(); if (node) { - if(_value) { + if(_value && !this.options.readonly) { $j(node).attr("required", "required"); } else { node.removeAttribute("required"); @@ -243,7 +243,7 @@ var et2_inputWidget = et2_valueWidget.extend([et2_IInput,et2_ISubmitListener], var ok = true; // 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')); ok = false;