浏览代码

Allow extra javascript to be added to checkboxes

pdontthink 20 年之前
父节点
当前提交
ebbab19065
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      functions/forms.php

+ 2 - 2
functions/forms.php

@@ -37,9 +37,9 @@ function addPwField($name , $value = null) {
 /**
 /**
  * Form checkbox
  * Form checkbox
  */
  */
-function addCheckBox($name, $checked = false, $value = null) {
+function addCheckBox($name, $checked = false, $value = null, $xtra = '') {
     return addInputField('checkbox', $name, $value,
     return addInputField('checkbox', $name, $value,
-        ($checked ? ' checked="checked"' : ''));
+        ($checked ? ' checked="checked"' : '') . ' ' . $xtra);
 }
 }
 
 
 /**
 /**