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

报告相同问题?