Smarty and Internet Explorer issue
| From: | Peggy Schatz | Date: | Fri, 26 Jan 2007 17:16:13 +0000 |
| Subject: | Smarty and Internet Explorer issue | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-13669@lists.php.net to get a copy of this message | ||
Hello,
I've built a complex site (using various included templates) with form fields and data coming from various database tables.
One drop-down-field is causing problems in IE6. It contains about 17.000 values (I know, that's not very fancy). IE is capable of dynamically creating and displaying this drop-down-list by using smarty's built-in function {html_options} or a customized function as follows:
function smarty_function_make_options($params, &$smarty)
{
$options = '<select name="' . $params['name'] . '" class="' . $params['class'] . '" style="' . $params['style'] .'" onchange="' . $params['onchange'] . '">';
$options .= '<option>' . join('</option><option>',$params['options']) . '</option>';
$options .= '</select>';
$options = str_replace(">". $params['selected']," selected>" . $params['selected'], $options);
echo $options;
}
But combined with all the other selects and features smarty won't load the page in IE. Firefox loads quick and withaut fault. I've cached the options-array using PEAR::CACHE_Lite, but this makes no difference in IE.
If I try to display the options as array {$pn_options}, no problem. But neither way of manipulating an assigned array (of that size) in order to get the select-box works, nor does writing the entire string (<select>...</select>) in PHP and assigning as is...
I also checked wheter the size of the resulting page would be to big for that certain browser by loading it in Firefox and saving as html-file. This way I could open it in IE.
That's why I assume it is a smarty-related problem...
Thanks for any advise,
Peggy