更新时间:2023-11-30 16:23:28
您可以为给定的JS代码创建其他简码,并将其插入(而不是插入,但要插入)联系表格7标记之后.
You can create additional shortcode for the given JS code and insert it after (not in,but after) contact form 7 tag.
所以看起来像这样
[contact-form-7 id ="122" title =与我们联系"][custom_js_for_cf7]
[contact-form-7 id="122" title="Contact Us"] [custom_js_for_cf7]
这是为此的简码,您可以将其添加到您的functions.php中:
And here is the shortcode code for this, you can add this to your functions.php:
add_shortcode('custom_js_for_cf7','custom_js_for_cf7');
function custom_js_for_cf7($args){
return '
<script>
document.getElementById("przycisk").disabled = true;
document.getElementById("numertel").addEventListener("keyup", function() {
var numerlength = this.value.length;
if (numerlength == 10 || numerlength == 9)
document.getElementById("przycisk").disabled = false;
else
document.getElementById("przycisk").disabled = true;
});
</script>
';
}