Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

How to set selected in a HTML Select Tag with VIewHelper


Im triing to preselect a Select Tag in Volt.

What I get so far:

 {{ select('langId', langs, 'using': ['id', 'name'], 'useEmpty': false,'ng-model':"orderProp") }}

I will no emtpy option. But the generated Code looks like this:

<select id="langId" name="langId" ng-model="orderProp" class="ng-pristine ng-valid">
    **<option value="? undefined:undefined ?"></option>**
    <option value="1">English</option>

IN the Docs i found nothing at: or here:

Can please anyone help me?


edited Mar '14

try using $this->tag->setDefault('langId', '1'); ('langId' as name of your tag and '1' as value you want selected by default) in your controller action

Thaaanks digitronac!