下拉列表框 select 动态赋值

<tr>

        <td class="label">所属群组:</td>

        <td>

          <select name="group" dataType="Require" msg="请选择群组">

            {foreach from=$arrgroups item=group}

              <option value="{$group.car_group_id}" {if $group.car_group_id eq $car.group}selected{/if} >{$group.car_group_name}</option>

            {/foreach}

          </select>   

        </td>

</tr>

  

Smarty赋值



 <tr>

            <td height="55">用户群组:</td>

            <td>

                <select name="group_id" >

                    <option value ="17">请选择</option>

                    {foreach from=$group_user item=group}

                      <option value="{$group.user_group_id}" {if $group.user_group_id eq $brand.user_group_id}selected{/if} >{$group.title}



</option>

                    {/foreach}     

              



                 </select>

            </td>

                 

        </tr>

 

你可能感兴趣的:(select)