在我的联系表 7 中,我正在使用管道系统,但我也想将电子邮件地址保存到其他字段中,所以我如何才能获得此帮助,例如,电子邮件值变为此短代码 [电子邮件] 我需要保存此值 [email1]
下拉代码:
[select* email-recipient include_blank "ECommerce Development|test@gmail.com" "Web Development|test@gmail.com" "Mobile Application Development|test@gmail.com" "Digital marketing|test@gmail.com" "IOT|test@gmail.com" "Chatbot|test@gmail.com"]
输入值:[隐藏hidden-701“管道电子邮件”]
最佳答案
在联系表单 7 的选择下拉列表中设置 id 属性,如
[select* email-recipient include_blank "ECommerce Development|harshk.magneto@gmail.com" "Web Development|harshk.magneto@gmail.com" "Mobile Application Development|harshk.magneto@gmail.com" "Digital marketing|harshk.magneto@gmail.com" "IOT|harshk.magneto@gmail.com" "Chatbot|harshk.magneto@gmail.com" id:email-recipientemail-recipient]
转到主题的 footer.php 文件 [即wp-content\themes\themename] 并添加以下代码。
<?php if(is_page(ID)) { ?>
<script type="text/javascript">
jQuery(document).ready(function () {
jQuery(document).on('change', '#email-recipient', function(){
jQuery("input[name=hidden-701]").val(jQuery('select#email-recipient option:selected').val());
});
});
</script>
<?php } ?>
其中 ID 是您包含此联系表单的页面 ID。
关于javascript - 联系表单7插件定制,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52287533/