Hi,
I've tried using the Smarty html_options function to produce a drop-down list box contain data from an array obtained from a database.
This works fine. However, I notice that I can't seem to get the html_options function to include an 'id' tag in the <select> tag it generates, only the name attribute.
This seems a glaring omission, as it would suggest I can't access it using the JavaScript DOM on all browsers using the more reliable getElementById() method.
Am I missing something?
Many thanks
ID attributes in Smarty design templates
Moderator: General Moderators
You don't have to have it generate the select tags, you can put in your own select tags with an id. If you omit the 'name' attribute in the smarty tag then only the option list will be generated.
Or you can go into the smarty source and edit the plugins/function.html_options.php file to have it add an id with the same value as the name. Its surprising at how easy it is to edit, or even create from scratch, smarty plugins.
Or you can go into the smarty source and edit the plugins/function.html_options.php file to have it add an id with the same value as the name. Its surprising at how easy it is to edit, or even create from scratch, smarty plugins.