|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
Kleduts Smarty n00b
Joined: 29 Mar 2011 Posts: 1
|
Posted: Tue Mar 29, 2011 10:01 am Post subject: Bug (minor) in the HTML_OPTIONS (pb of id and optgroup) |
|
|
Hi,
I think I have found a (minor) bug in the HTML_OPTIONS.
The problem is when you create select list with optgroup. The current code (3.0.7) generates ids with concatenation.
But if you don't define inital id, the generated id looks like "-3-4". And HTML validation don't appreciate this kind of id.
The solution is (line 117 in the function.html_options.php file) :
Code: | // $_html_result = smarty_function_html_options_optgroup($key, $value, $selected, $id.'-'.$idx, $class, $_idx);
$_html_result = smarty_function_html_options_optgroup($key, $value, $selected, (!empty($id) ? $id.'-'.$idx : ''), $class, $_idx); |
Replace the $id.'-'.$idx by the test : (!empty($id) ? $id.'-'.$idx : '').
Regards
Fabrice
from Bordeaux - France |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|