Re: [SMARTY] html_options is possible to do that ?
Danilo Buerger <[email protected]>
| Newsgroups | gmane.comp.php.smarty.general |
|---|---|
| Message-ID | <[email protected]> |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
http://smarty.php.net/manual/en/language.function.html.options.php
You need an associative array. Just fill $arrCat with IDC as keys and
CNombre as values. Then use {html_options} options attribute.
Reynier Perez Mira schrieb:
> I have this PHP Code:
> $sql = $db->Execute("SELECT IDC, CNombre FROM os_catproductos ORDER BY IDC ASC");
> $arrCat = array();
> while ( $categorias = $sql->fetchRow() ) {
> $arrCat[] = $categorias;
> }
> $tpl->assign('catArr', $arrCat);
>
> Then I need to build an SELECT working with catArr values. I try this in template:
>
> <select id="arrCatSELECT" id="arrCatSELECT" size="1" onchange="javascript:document.location.href='index.php?cPath={$catArr.IDC}';">{html_options values={$catArr.IDC} output=$catArr.ANombre}</select>
>
> But it not works. Any help ?
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFD64cUtyx3EHt/UjARAhcYAJ9KpuUWlGrJkx+Ibkxulmnyg25tvwCdFz0K
Vbip5+HFzxSfQ8D1UuGOZ5I=
=lW62
-----END PGP SIGNATURE-----
--
Smarty General Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php