我在循环单选按钮组的时候,<{html_radios name=toupiao values=1 checked=true}>中的values的值替换过来啊?内容已经显示了:<{$vote[showVote].voteNeirong}>

解决方案 »

  1.   

    暈哦!沒有人知道smarty?????我的checked給的是true怎么不被選中啊?請大家幫忙啊!
      

  2.   

    你话都没说清楚,没明白你问的是什么,看下面这个例子:
    //////////////////////php
    $smarty->assign('cust_radios', array(
                                   1000 => 'Joe Schmoe',
                                   1001 => 'Jack Smith',
                                   1002 => 'Jane Johnson',
                                   1003 => 'Charlie Brown'));
    $smarty->assign('customer_id', 1001);
    ///////////////////////tpl
    {html_radios name='id' options=$cust_radios
         selected=$customer_id separator='<br />'}
      

  3.   

    radios标签没有checked这个属性,要用selected