1
jcera
<select name = "name"><{$optionsarray}></select>
  • 2004/6/13 9:18

  • jcera

  • Just popping in

  • Posts: 72

  • Since: 2004/6/5 6


hi. i wrote that script in my XOOPS template but my drop down box is still empty.

using the smarty debugger, it says that my smarty variable is not empty. i'm supposed to get 4 options:

A
B
C
D

..and by the way, all four belong only to one index. this is what it looks like:

$optionsarray[0] = A,B,C,D

can anyone help me?

2
jcera
Re: <select name = "name"><{$optionsarray}></select>
  • 2004/6/13 13:36

  • jcera

  • Just popping in

  • Posts: 72

  • Since: 2004/6/5 6


..and by the way..

i tried the following, too:

<select name = "name"><{html_options values = $optionsarray}></select>

..but i still get a blank dropdown box.

3
Dave_L
Re: <select name = "name"><{$optionsarray}></select>
  • 2004/6/13 13:53

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


Your second example looks right, but how exactly are you initializing $optionsarray? It should look something like this, in the .php file that generates the content for the template:

$xoopsTpl->assign('optionsarray', array('A','B','C','D'));

Here's the documentation for the Smarty function html_options, which shows some examples:http://smarty.php.net/manual/en/language.function.html.options.php

You could look at the compiled template in /templaces_c, to see what code Smarty is generating.

4
jcera
Re: <select name = "name"><{$optionsarray}></select>
  • 2004/6/13 14:52

  • jcera

  • Just popping in

  • Posts: 72

  • Since: 2004/6/5 6


thanks! i solved this one. it turned out i was trying to input the wrong value. plus, i used the implode array function, which is why they're all in the same index.

Login

Who's Online

122 user(s) are online (65 user(s) are browsing Support Forums)


Members: 0


Guests: 122


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits