2014-11-02 36 views
1

我已經用Bootstrap做了一個表單。有一個圖像按鈕來提交表單,但是當我點擊它時,沒有任何反應。Bootstrap表單不會提交圖像按鈕

<form name="input" action="index.php" method="post" class="form-horizontal">      
    <div class="input-group"> 
     <span class="input-group-addon">@</span> 
     <input name="coins" type="text" class="form-control" placeholder="Quanity" > 
    </div><br> 
    <div class="input-group"> 
     <span class="input-group-addon">@</span> 
     <input type="text" class="form-control" name="usd" placeholder="USD" > 
    </div><br> 
    <div class="input-group"> 
     <span class="input-group-addon">@</span> 
     <input type="text" class="form-control" name="paypal" placeholder="PayPal Address" > 
    </div><br> 
    <div class="input-group"> 
     <input type="image" src="/img/ppbutton.png" name="submit" alt="PayPal - The safer, easier way to pay online!"> 
    </div><br> 
</form> 

回答

0

嘗試增加this.form.submit象下面這樣:

<input type="image" onclick="this.form.submit()" src="/img/ppbutton.png" name="submit" alt="PayPal - The safer, easier way to pay online!"> 
2

你的提交按鈕必須是一個按鈕/ submit並用CSS樣式:

<style> 
div.submitter input { 
    /*you will need to adjust your stylesheet so it looks the way you want.*/ 
    width: 100px; 
    height: 40px; 
    background-image: url(/img/ppbutton.png); 
    background-repeat: no-repeat; 
    border: 1px solid; 
    } 
</style> 

<!-- REPLACE IN YOUR FORM --> 
<div class="submitter"><input type="submit" name="submit" alt="PayPal - The safer, easier way to pay online!" /></div> 
+0

這使得按鈕圖片頂部,按鈕也無法提交。 – user4185882 2014-11-02 16:49:29