例如,如何填寫表單“a”并自動填寫表單“b”而不以重力形式向用戶顯示?
uj5u.com熱心網友回復:
您可以將以下內容添加到您的 functions.php 代碼中,以將表格 A 中的條目值復制到表格 B 中的新條目
//after submission
add_action( 'gform_after_submission_20', 'submit_form_b', 10, 2 );//replace 20 with the form id of Form A
function submit_form_b($entry_a, $form ){
$entry_b = array(
"form_id" => '30',//replace 30 with the form id of Form B
"4" => $entry_a['1'],//replace "4" with the field id # from Form B. Replace '1' with the field id from Form A
"5" => $entry_a['2'],//replace "5" with the field id # from Form B. Replace '2' with the field id from Form A
"6" => $entry_a['3']//replace "6" with the field id # from Form B. Replace '3' with the field id from Form A
);
$create_entry = GFAPI::add_entry($entry_b);//this line creates a new entry for form B
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/522452.html
標籤:形式重力
上一篇:ASP.NET分頁重置為多個表單
