Why weren't tag IDs part of the parameters to these functions in the first place...
authorpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 14 Mar 2005 00:06:12 +0000 (00:06 +0000)
committerpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 14 Mar 2005 00:06:12 +0000 (00:06 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@9014 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/forms.php

index be4709d98ab3c80edd2d51b510e0e3207c4575e8..d1a96888e3fbb794d676b052a8d84510c5df55de 100644 (file)
  * Helper function to create form fields, not to be called directly,
  * only by other functions below.
  */
-function addInputField($type, $name = null, $value = null, $attributes = '') {
+function addInputField($type, $name = null, $value = null, $attributes = '', $id = null) {
     return '<input type="'.$type.'"'.
         ($name  !== null ? ' name="'.htmlspecialchars($name).'"'   : '').
+        ($id  !== null ? ' id="'.htmlspecialchars($id).'"'   
+            : ($name  !== null ? ' id="'.htmlspecialchars($name).'"'   : '')).
         ($value !== null ? ' value="'.htmlspecialchars($value).'"' : '').
         $attributes . " />\n";
 }
@@ -45,7 +47,7 @@ function addCheckBox($name, $checked = false, $value = null) {
  */
 function addRadioBox($name, $checked = false, $value = null) {
     return addInputField('radio', $name, $value,
-        ($checked ? ' checked="checked"' : ''));
+        ($checked ? ' checked="checked"' : ''), $name . $value);
 }
 
 /**
@@ -144,4 +146,4 @@ function addForm($action, $method = 'post', $name = '', $enctype = '', $charset
         $enctype . $name . $charset . ">\n";
 }
 
-?>
\ No newline at end of file
+?>