|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
Frank Smarty Rookie
Joined: 18 Apr 2003 Posts: 6
|
Posted: Tue Jul 22, 2003 11:25 am Post subject: Problem with a dropdown menu and Select |
|
|
Hello,
I have 2 arrays in which I assigned usergroups and specific userdata. Now I want to make a dropdown menu of it so I do this in my template:
<select size="1" name="gebruiker_groep">
{foreach from="$gebruikersgroepen" item=gebruikersgroepen}
{if $gebruikersgroepen.groep_id eq $gebruikerdata.groep_id}
<option value="{$gebruikersgroepen.groep_id}" SELECTED>{$gebruikersgroepen.groep_naam}</option>
{else}
<option value="{$gebruikersgroepen.groep_id}">{$gebruikersgroepen.groep_naam}</option>
{/if}
{/foreach}
</select>
The problem is that it won't select the right usergroup. How can I solve this without using the HTML Select options that are standard in Smarty. Because when I do that, I must change my array structure |
|
Back to top |
|
mpk Smarty Rookie
Joined: 26 Jun 2003 Posts: 9 Location: Amsterdam, Netherlands
|
Posted: Wed Jul 23, 2003 7:17 am Post subject: |
|
|
You must use html_options like this
{html_options values=$gebruikersgroepen.groep_id selected=gebruikerdata.groep_id output=$gebruikersgroepen.groep_naam} |
|
Back to top |
|
Frank Smarty Rookie
Joined: 18 Apr 2003 Posts: 6
|
Posted: Wed Jul 23, 2003 11:40 am Post subject: |
|
|
Unfortunatly that doesn't work. My dropdown remains empty. |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|