0

我有一个在 chrome 中完美运行的表单,但在 ie 中根本无法使用。

实际表单的代码是:

<div id="launch">
    <form id="form1" name="form1" method="post" action="" > 
        <input type="image" src="images/transparent.png" width="100" height="100" name="Launch" id="Launch" value="insertvaluehere" />
    </form> 
</div>

当按下表单时,我使用这个 if 语句来执行代码:

if (($_POST['Launch']) && ($available1 == 0))
{
//Code for what is done.
}

所有帮助将不胜感激。

4

2 回答 2

1

您可以将其更改为

<button type="submit" name="launch" id="Launch">Submit</button>

然后使用

    #Launch{
        background-image:url(images/transparent.png); 
        width:100px; 
        height:100px; 
        dislay:block; 
        border:none; 
        color:transparent;
        background-color:none;
        cursor:pointer;
   }

改变:

if ($_POST)
{
    //execute
}
于 2012-07-25T22:31:27.807 回答
0

输入类型的图片一般不提交值,而是提交用户点击图片的坐标(一般用作图片地图)。

如果您致力于使用图像提交,您有两个主要选择:

  1. <input>带有隐藏字段的常规提交类型,其中包含您想要的值(您可以使用 CSS 将提交样式设置为图像)
  2. 一种<button>
于 2012-07-25T22:56:15.170 回答