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条)

报告相同问题?

悬赏问题

  • ¥35 平滑拟合曲线该如何生成
  • ¥100 c语言,请帮蒟蒻写一个题的范例作参考
  • ¥15 名为“Product”的列已属于此 DataTable
  • ¥15 安卓adb backup备份应用数据失败
  • ¥15 eclipse运行项目时遇到的问题
  • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
  • ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
  • ¥15 自己瞎改改,结果现在又运行不了了
  • ¥15 链式存储应该如何解决
  • ¥15 没有证书,nginx怎么反向代理到只能接受https的公网网站