gpt4 book ai didi

提交时 PHP 未检测到 css 自定义按钮?

转载 作者:行者123 更新时间:2023-11-28 05:45:43 25 4
gpt4 key购买 nike

所以我有一个我正在使用的设计,但是由于某种原因我无法在我的表单上检测到按钮,我尝试了很多事情,例如尝试检测类名,更改名称,由于某种原因,通过 html 为其分配了一个名称,但没有任何效果。这是我的按钮。

.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;
}

以及我如何在我的 html 表单上调用它:

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

我已经尝试使用 blue_button 并使用我的 PHP 代码注册,但仍然无法检测到它,我的 php 代码没有问题我一秒钟前在空白 html 表单上测试过它。

最佳答案

如果你不想使用<input type="submit" .../>您可以在 javascript 的帮助下提交表单(使用经典内联 js 的示例):

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

更新 现代 jQuery 示例

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

关于提交时 PHP 未检测到 css 自定义按钮?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37623221/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com