Menu drop down which does not use item id as default?
I have a form in Joomla which has a drop down menu with a number of items
to select. The problem is that if the form is saved and someone chooses
not to choose one of the items (not mandatory), then the first item in the
list on this menu is selected by default. Now I could I guess in the
backend create a new blank item with no name and give it the id=1 to show
as first in the list but was wondering if there was another way. The
current code is:
<tr>
<td align="right" class="componentskey">
<label for="items_id"> <?php echo JText::_( 'ITEMS' ); ?></label>
</td>
<td>
<select name="items_id" id="items_id">
<?php echo ItemsHelper::show_items_tree($this->items,0,
$this->item->items_id); ?>
</select>
</td>
</tr>
Any help would be appreciated,
Thanks.
No comments:
Post a Comment