From ae3f158d2cdf511da19a9b55caf543bd807e4c0e Mon Sep 17 00:00:00 2001 From: Douglas Medrano Chura Date: Thu, 9 Jun 2011 15:26:24 -0400 Subject: [PATCH] BUG 7042 Solved the validation of the field date in dynaform Grid The problem was solved modificating the validation of the field date --- gulliver/js/grid/core/grid.js | 10 ++++++++++ gulliver/system/class.xmlform.php | 6 +++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/gulliver/js/grid/core/grid.js b/gulliver/js/grid/core/grid.js index 01170191b..9f4ea1416 100644 --- a/gulliver/js/grid/core/grid.js +++ b/gulliver/js/grid/core/grid.js @@ -270,6 +270,16 @@ var G_Grid = function(oForm, sGridName){ } //Create new 'a' to trigger DatePicker var a2 = document.createElement('a'); + + if( a2.style.setAttribute ) { + var styleText = "position:relative;top:0px;left:-19px;"; + a2.style.setAttribute("cssText", styleText ); + } + else { + var styleText = "position:relative;top:0px;left:-22px;"; + a2.setAttribute("style", styleText ); + } + a2.id = datePickerTriggerId; a2.innerHTML = img2; oNewRow.getElementsByTagName('td')[i].appendChild(a2); diff --git a/gulliver/system/class.xmlform.php b/gulliver/system/class.xmlform.php index 734b7b1f7..dd80d4f0f 100644 --- a/gulliver/system/class.xmlform.php +++ b/gulliver/system/class.xmlform.php @@ -3356,7 +3356,7 @@ class XmlForm_Field_Date extends XmlForm_Field_SimpleText } else { $isRequired = '0'; } - $html = '' . htmlentities ( $v, ENT_COMPAT, 'utf-8' ); + $html = 'NSRequiredValue().' class="module_app_input___gray" id="form[' . $owner->name . '][' . $r . '][' . $this->name . ']" name="form[' . $owner->name . '][' . $r . '][' . $this->name . ']" type ="text" size="' . $this->size . '" maxlength="' . $this->maxLength . '" value="' . $this->htmlentities ( $v, ENT_COMPAT, 'utf-8' ) . '" required="' . $isRequired . '" style="display:none;' . htmlentities ( $this->style, ENT_COMPAT, 'utf-8' ) . '"/>' . htmlentities ( $v, ENT_COMPAT, 'utf-8' ); } else { $id = 'form[' . $owner->name . '][' . $r . '][' . $this->name . ']'; $html = $this->__draw_widget ( $id, $v, $owner ); @@ -3554,7 +3554,7 @@ class XmlForm_Field_Date extends XmlForm_Field_SimpleText } if ( $this->editable != "0") { - $html = '' + $html = '' . '' . ' ' . '' @@ -3563,7 +3563,7 @@ class XmlForm_Field_Date extends XmlForm_Field_SimpleText . '' . ''; } else { - $html = '' + $html = '' . '' . ' ' . ''