HTML Input (type=image) not working on Firefox 4

前端 未结 7 2003
说谎
说谎 2020-12-12 06:16

The above HTML code is for

相关标签:
7条回答
  • 2020-12-12 06:47

    Suppose:

    <input type="image" name="submit" src="signout.png" />

    If you are using php, change your code from

    if(isset($_POST['submit']))
    

    to

    if(isset($_POST['submit_x']))`
    
    0 讨论(0)
  • 2020-12-12 06:50

    The problem with using <button name="cmd_delete" value=""><img src=".."/></button> is that you still see the button behind the image. It looks horrible. Why is this negative voted...it is true, I tried it!

    0 讨论(0)
  • 2020-12-12 06:51

    You could use <button name="cmd_delete" value=""><img src=".."/></button> instead of input.

    0 讨论(0)
  • 2020-12-12 06:51

    You're basically abusing the <input type="image"> to have a button with a background image. The <input type="image"> represents an image map. The mouse position on the button is been sent as cmd_delete.x and cmd_delete.y parameters. But you are not interested in the mouse position. Replace it by a normal <input type="submit"> and use CSS to specify a background image. E.g.

    <input type="submit" name="cmd_delete" class="delete" value="" />
    

    with

    input.delete {
        background-image: url('bin/images/common/delete.png');
        width: 20px;
        height: 20px;
        border: 0;
        cursor: pointer;
    }
    

    and check it as follows

    if (isset($_GET['cmd_delete'])) {
        // Delete button pressed.
    }
    
    0 讨论(0)
  • 2020-12-12 06:51

    Following works in IE, FF (and IE6, BalusC!):

    <input type="submit" value="" style="background-image: url('bin/images/common/delete.png');width:262px;height:37px;border:0;cursor: pointer;" />
    
    0 讨论(0)
  • 2020-12-12 07:05

    Try:

    <input type="button" class=”button” value="Delete" title="Delete" name="cmd_delete" />
    
    .button{
          background: url('bin/images/common/delete.png') no-repeat top;
    }
    
    0 讨论(0)
提交回复
热议问题