如何将选择转换为复选框

时间:2010-03-17 11:59:37

标签: php javascript jquery html smarty

这听起来很奇怪,但我有这个鳕鱼,我需要将它转换为复选框,具有相同的功能

 <select onchange="document.getElementById('reasonDiv{$test->id}').style.display = '';
  document.getElementById('reason{$test->id}').value = this.value;" name='reasonId{$test->id}' id='reasonId{$test->id}'>
  <option value=''>Test</option>
  {foreach item=test from=$testtmp.6}
      <input type="checkbox" value='{include file='testen.tpl'
     blog=$test1 member=$test2 contents=$test->contents replyId=$test->predefinedreplyid }' label='{$test->predefinedreplyid}'
     {if $test->predefinedreplyid==$test1->declineId}selected="selected"{/if}>{$test->subject}</option>
  {/foreach}
 </select>

我该怎么做?谢谢你的帮助

1 个答案:

答案 0 :(得分:3)

  {foreach item=test from=$testtmp.6}
      <input type="radio" name='reasonId{$test->id}' onClick="onchange="document.getElementById('reasonDiv{$test->id}').style.display = '';
  document.getElementById('reason{$test->id}').value = this.value;" type="checkbox" value='{include file='testen.tpl'
     blog=$test1 member=$test2 contents=$test->contents replyId=$test->predefinedreplyid }' label='{$test->predefinedreplyid}'
     {if $test->predefinedreplyid==$test1->declineId}selected="selected"{/if}>{$test->subject}/>
  {/foreach}

我认为应该这样做:)