From 1d2af84bffb5703a9bbd6bc5b07f983f22f3c369 Mon Sep 17 00:00:00 2001 From: xue <> Date: Fri, 9 Mar 2007 21:49:48 +0000 Subject: merge from 3.0 branch till 1755. --- framework/Web/UI/WebControls/TCheckBox.php | 3 ++- framework/Web/UI/WebControls/THiddenField.php | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'framework') diff --git a/framework/Web/UI/WebControls/TCheckBox.php b/framework/Web/UI/WebControls/TCheckBox.php index df90fc9a..bf2f9d05 100644 --- a/framework/Web/UI/WebControls/TCheckBox.php +++ b/framework/Web/UI/WebControls/TCheckBox.php @@ -280,7 +280,8 @@ class TCheckBox extends TWebControl implements IPostBackDataHandler, IValidatabl $attributes=$this->getAttributes(); $value=$attributes->remove('value'); // onclick js should only be added to input tag - $onclick=$attributes->remove('onclick'); + if(($onclick=$attributes->remove('onclick'))===null) + $onclick=''; if($attributes->getCount()) { $writer->addAttributes($attributes); diff --git a/framework/Web/UI/WebControls/THiddenField.php b/framework/Web/UI/WebControls/THiddenField.php index 8a8a0c8a..acead9f0 100644 --- a/framework/Web/UI/WebControls/THiddenField.php +++ b/framework/Web/UI/WebControls/THiddenField.php @@ -59,6 +59,13 @@ class THiddenField extends TControl implements IPostBackDataHandler, IValidatabl $writer->addAttribute('id',$this->getClientID()); if(($value=$this->getValue())!=='') $writer->addAttribute('value',$value); + + if($this->getHasAttributes()) + { + foreach($this->getAttributes() as $name=>$value) + $writer->addAttribute($name,$value); + } + $writer->renderBeginTag('input'); $writer->renderEndTag(); } -- cgit v1.2.3