added label attribute to all option outputs, cover w3c spec.

This commit is contained in:
mohrt
2002-11-01 15:32:42 +00:00
parent 1ec62d9df7
commit 1bda2fb5ac
2 changed files with 2 additions and 2 deletions

View File

@@ -43,7 +43,7 @@ function smarty_function_html_options($params, &$smarty)
function smarty_function_html_options_optoutput($key, $value, $selected) { function smarty_function_html_options_optoutput($key, $value, $selected) {
if(!is_array($value)) { if(!is_array($value)) {
$html_result = "<option value=\"$key\""; $html_result = "<option label=\"$key\" value=\"$key\"";
if (in_array($key, $selected)) if (in_array($key, $selected))
$html_result .= " selected=\"selected\""; $html_result .= " selected=\"selected\"";
$html_result .= ">$value</option>\n"; $html_result .= ">$value</option>\n";

View File

@@ -43,7 +43,7 @@ function smarty_function_html_options($params, &$smarty)
function smarty_function_html_options_optoutput($key, $value, $selected) { function smarty_function_html_options_optoutput($key, $value, $selected) {
if(!is_array($value)) { if(!is_array($value)) {
$html_result = "<option value=\"$key\""; $html_result = "<option label=\"$key\" value=\"$key\"";
if (in_array($key, $selected)) if (in_array($key, $selected))
$html_result .= " selected=\"selected\""; $html_result .= " selected=\"selected\"";
$html_result .= ">$value</option>\n"; $html_result .= ">$value</option>\n";