diff options
Diffstat (limited to 'framework/Web/UI/WebControls/TImageButton.php')
| -rw-r--r-- | framework/Web/UI/WebControls/TImageButton.php | 11 | 
1 files changed, 10 insertions, 1 deletions
| diff --git a/framework/Web/UI/WebControls/TImageButton.php b/framework/Web/UI/WebControls/TImageButton.php index f5c331c1..41de5087 100644 --- a/framework/Web/UI/WebControls/TImageButton.php +++ b/framework/Web/UI/WebControls/TImageButton.php @@ -105,7 +105,7 @@ class TImageButton extends TImage implements IPostBackDataHandler, IPostBackEven  			$writer->addAttribute('name',$uniqueID);
  		if($this->getEnabled(true))
  		{
 -			if($this->getEnableClientScript() && $this->canCauseValidation())
 +			if($this->getEnableClientScript() && $this->needPostBackScript())
  				$this->renderClientControlScript($writer);
  		}
  		else if($this->getEnabled()) // in this case, parent will not render 'disabled'
 @@ -148,6 +148,15 @@ class TImageButton extends TImage implements IPostBackDataHandler, IPostBackEven  	}
  	/**
 +	 * @return boolean whether the button needs javascript to do postback
 +	 */
 +	protected function needPostBackScript()
 +	{
 +		//IE needs JS to be rendered for default button to work if no validators are assigned to this button
 +		return $this->canCauseValidation() || $this->hasEventHandler('OnClick') || $this->hasEventHandler('OnCommand');
 +	}
 +
 +	/**
  	 * Returns postback specifications for the button.
  	 * This method is used by framework and control developers.
  	 * @return array parameters about how the button defines its postback behavior.
 | 
