fixed onchange() when clicking on checkbox label

This commit is contained in:
Roland Gruber 2012-01-08 19:04:35 +00:00
parent 6981d02b97
commit 2a219cd0b2
1 changed files with 2 additions and 2 deletions

View File

@ -1507,7 +1507,7 @@ class htmlTableExtendedInputCheckbox extends htmlInputCheckbox {
* @return array List of input field names and their type (name => type) * @return array List of input field names and their type (name => type)
*/ */
function generateHTML($module, $input, $values, $restricted, &$tabindex, $scope) { function generateHTML($module, $input, $values, $restricted, &$tabindex, $scope) {
$onClick = 'onClick="jQuery(\'#' . $this->name . '\').attr(\'checked\',!jQuery(\'#' . $this->name . '\').attr(\'checked\'));"'; $onClick = 'onClick="jQuery(\'#' . $this->name . '\').attr(\'checked\',!jQuery(\'#' . $this->name . '\').attr(\'checked\')); jQuery(\'#' . $this->name . '\').change();"';
if ($this->labelFirst) { if ($this->labelFirst) {
echo '<div class="nowrap" ' . $onClick . '>'; echo '<div class="nowrap" ' . $onClick . '>';
echo $this->label; echo $this->label;
@ -1752,7 +1752,7 @@ class htmlTableExtendedInputTextarea extends htmlInputTextarea {
* @param String $label descriptive label * @param String $label descriptive label
* @param String $helpID help ID * @param String $helpID help ID
*/ */
function __construct($name, $value, $colCount, $rowCount, $label, $helpID) { function __construct($name, $value, $colCount, $rowCount, $label, $helpID = null) {
parent::__construct($name, $value, $colCount, $rowCount); parent::__construct($name, $value, $colCount, $rowCount);
$this->label = htmlspecialchars($label); $this->label = htmlspecialchars($label);
$this->helpID = $helpID; $this->helpID = $helpID;