doudula1974 2016-06-03 20:52
浏览 34
已采纳

PHP在提交时没有检测到css自定义按钮?

so I have a design i'm using, however for some reason i can't get the button to get detected on my form, i've tried many things such as, trying to detect the class name, changing the name, assigning it an name via html for some reason nothing's working. Here is my button.

.blue_button
{
background: #005b66;
background: -moz-linear-gradient(top,  #005b66 0%, #07252d 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#005b66), color-stop(100%,#07252d));
background: -webkit-linear-gradient(top,  #005b66 0%,#07252d 100%);
background: -o-linear-gradient(top,  #005b66 0%,#07252d 100%);
background: -ms-linear-gradient(top,  #005b66 0%,#07252d 100%);
background: linear-gradient(to bottom,  #005b66 0%,#07252d 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#005b66', endColorstr='#07252d',GradientType=0 );
border-radius: 3px;
display: inline-block;
position: relative;
margin: 0 auto;
bottom: 58px;
border: 1px solid #033f47;
width: 128px;
height: 30px;
color: white;
font-weight: 100;
}

and how i'm calling it on my html form:

<form method="POST">
<div type="submit" name="register" class="blue_button"><div class="blue_button_text noselect" name="register" type="submit">Register</div></div>
</form>

I've tried blue_button & register with my PHP code, still couldn't detect it, there's no issues with my php code i tested it on a blank html form a second ago.

  • 写回答

3条回答 默认 最新

  • ds3422222222 2016-06-03 21:05
    关注

    If you don't want to use <input type="submit" .../> you can submit a form with the help of javascript (example with classic inline js):

    <form method="POST" name="myForm">
    <div ... onClick="myForm.submit();"></div>
    </form>
    

    UPDATE Modern jQuery Example

    <html>
    <head>
    <script type="text/javascript">
    $(function() {
       $('#myButton').click(function(e) {
            $("#myForm").submit();
        });
    });
    </script>
    </head>
    <body>
    <form ... id="myForm">
    <div ... id="myButton"></div>
    </form>
    </body>
    </html>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥16 mybatis的代理对象无法通过@Autowired装填
  • ¥15 可见光定位matlab仿真
  • ¥15 arduino 四自由度机械臂
  • ¥15 wordpress 产品图片 GIF 没法显示
  • ¥15 求三国群英传pl国战时间的修改方法
  • ¥15 matlab代码代写,需写出详细代码,代价私
  • ¥15 ROS系统搭建请教(跨境电商用途)
  • ¥15 AIC3204的示例代码有吗,想用AIC3204测量血氧,找不到相关的代码。