Advertisement
HarunRRayhan

Gravity Form Change Form Field Data Pre Submission hook

Jun 2nd, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.64 KB | None | 0 0
  1. // Populate User Level Risk Data (form ID 4)
  2. // add_action( 'gform_pre_submission_4', 'hrx_bigshot_pre_submission2' );
  3. function hrx_bigshot_pre_submission2( $form ) {
  4.     $UserLevel = rgpost( 'input_1' );
  5.  
  6.     if($UserLevel == 'LowRisk'){
  7.         $_POST['input_5'] = rgpost( 'input_2' );
  8.     } elseif ($UserLevel == 'MidRisk') {
  9.         $_POST['input_5'] = rgpost( 'input_3' );
  10.     } elseif ($UserLevel == 'HighRisk') {
  11.         $_POST['input_5'] = rgpost( 'input_4' );
  12.     }
  13. }
  14.  
  15. // add_action( 'gform_pre_submission_3', 'hrx_bigshot_pre_submission' );
  16. function hrx_bigshot_pre_submission( $form ) {
  17.     $_POST['input_39'] = print_r($form, true);
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement