I need a drop-down menu that lists a number of subjects, something along the lines of the snippet below.
<div class="publish_l_r"><?php echo elgg_view('input/access',array('internalname' => "category", 'options' => array("","Astronomy","Animal Science","Accounting & Finance"), 'value' => $category,'class'=>'inp_big'));?> </div>
The problem with this code is that when the subject is chosen, a number is saved instead of the actual name. Can anyone point out what I'm doing wrong?
Thanks!
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- Evan Winslow@ewinslow
Evan Winslow - 0 likes
- Michael Camilleri@michaelcamilleri
Michael Camilleri - 0 likes
- Tom@tomv
Tom - 0 likes
You must log in to post replies.You are using input/access. You should use input/pulldown
Excellent! Thanks a lot!
One last issue left: The last item in the list is currently selected by default - how can I change that to be the first item?
Did you check the code of that view? ( /views/default/input/pulldown.php ) it helps to understand how to use it... I just had a look and it seems that if you preset the value on the first item, you get what you want...