2014-01-21 12 views

回答

1

你結合的情況下到窗體Click事件。嘗試添加另一個按鈕並將事件附加到它。

<form action="voteupdate.php" id="form-id" method="post"> 
    <input type="hidden" name="type" id="type" value="' . $type . '"> 
    <input type="hidden" name="id" id="id" value="' . $id . '"> 
    <div class="btn-group" data-toggle="buttons"> 
    <label class="btn btn-default '.$vup.'"> 
     <input type="radio" name="vote" id="1" value="1"> 
    <span class="glyphicon glyphicon-chevron-up"></span> Vote up 
    </label> 
    <label class="btn btn-default '.$vd.'"> 
     <input type="radio" name="vote" id="2" value="2"> 
    <span class="glyphicon glyphicon-chevron-down"></span> Vote down  
    </label>  
    </div> 
    <input type="button" value="Submit" onclick="setTimeout(function(){ document.getElementById('form-id').submit(); }, 1000)" /> 


</form> 
+0

被毆打秒.... – Liran

+0

按鈕無效 – user2570264

+0

對不起,有一個額外的'}'在年底的onclick之前的'「'。刪除它,因爲我更新的代碼。 –