簡體   English   中英

在聯系表單7(CF7)中發送HTML值

[英]Sending HTML values in Contact Form 7 (CF7)

目前,我的頁面上有一些JS按鈕,並且在按鈕下方有一個CF7聯系人表格

我在此頁面上有一個字段,該字段顯示由按鈕<input type="number" id="price"/>

我想知道是否有一種簡單的方法可以使用document.getElementById('price').value類的東西在CF7電子郵件中發送document.getElementById('price').value

希望能有所幫助!

您可以在cf7中為價格創建隱藏字段:

// hidden was css class for hidding field, id is your input price id for cf7
[number price class:hidden  id:price_to_send]

然后從cf7以外的輸入價格中將價值增加到隱藏字段中

$('#price').change(function() {
    $('#price_to_send').val($(this).val());
});

注意:如果需要在發送之前驗證輸入,則可以使用wpcf7_before_send_mail操作或其他操作/過濾器: http ://hookr.io/plugins/contact-form-7/4.7/

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM