php
  • javascript
  • jquery
  • html
  • smarty
  • 2010-03-17 55 views 1 likes 
    1

    這聽起來很奇怪,但我有這個鱈魚和我需要將其轉換爲複選框,與同功能如何轉換一個選擇的複選框

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

    我怎樣才能做到這一點?感謝您的幫助

    回答

    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} 
    

    我認爲它應該做的伎倆:)

    +0

    YEPP這個工作對我來說由於有一個愉快的一天 – streetparade 2010-03-17 12:39:20

    相關問題