Php 如何将选择转换为复选框

Php 如何将选择转换为复选框,php,javascript,jquery,html,smarty,Php,Javascript,Jquery,Html,Smarty,这听起来很奇怪,但我有这个cod,我需要将它转换为checkbox,具有相同的功能 <select onchange="document.getElementById('reasonDiv{$test->id}').style.display = ''; document.getElementById('reason{$test->id}').value = this.value;" name='reasonId{$test->id}' id='reasonId{$

这听起来很奇怪,但我有这个cod,我需要将它转换为checkbox,具有相同的功能

 <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>

试验
{foreach item=testfrom=$testtmp.6}
predefinedreplyid==$test1->declineId}selected=“selected”{/if}>{$test->subject}
{/foreach}
我该怎么做?感谢您的帮助

{foreach item=testfrom=$testtmp.6}
  {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}