2014-11-02 45 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