教程转自:星空知-子比主题功能 – 友情链接页添加勾选条款
效果预览:
代码修改:
文件路径:/opt/1panel/apps/openresty/openresty/www/sites/www.catchyxc.com/index/wp-content/themes/zibll/inc/functions/functions.php
搜索“人机验证”,如下图插入代码
<input type="checkbox" name="checkbox[]" onchange="checkAll()"> 我已认真阅读并符合以上条件 <br><br/>
<button id = "juanyi_submit_friend" class="but c-blue padding-lg wp-ajax-submit" disabled><i class="fa fa-check" aria-hidden="true"></i>提交链接</button>
$card .='<script>
function checkAll() {
var checkboxes = document.getElementsByName("checkbox[]");
var button = document.getElementById("juanyi_submit_friend");
var allChecked = true;
for (var i = 0; i < checkboxes.length; i++) {
if (!checkboxes[i].checked) {
allChecked = false;
break;
}
}
if (allChecked) {
button.classList.add("enabled");
button.disabled = false;
} else {
button.classList.remove("enabled");
button.disabled = true;
}
}
</script>';
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END
暂无评论内容