• Resolved giuls22

    (@giuls22)


    Hi, Could someone please point me to the method or function which is called when a WPForm is submitted successfully?

    I am trying to write some custom PHP to display a “Loading Popup” once the form is successfully submitted before redirecting the user to the page.

    Will happily share the PHP code once working! ??

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • 
     add_action("wpforms_process_complete_9", 'function_save_custom_form_data');
     
     
     function function_save_custom_form_data($params) {
    		
         foreach($params as $idx=>$item) {
            $params2 = $params2 +  $item['name'] + '' + $item['value'];
            	 
        } 
    ......
    

    Hi giuls22,

    We don’t currently have a way to do what you’re looking for with PHP. However, you should be able to target this point in the submission process using JavaScript.

    I apologize as we’re not able to provide support for the customization involved with this, but I hope that helps to get you on the right track! ??

    Thread Starter giuls22

    (@giuls22)

    @yessoftmk I’m can’t seem to get it to trigger a javascript alert…Do I need to pass in my form ID into the function?

    add_action("wpforms_process_complete_9", 'function_save_custom_form_data');
     
     
     function function_save_custom_form_data($params) {
    		
         foreach($params as $idx=>$item) {
            $params2 = $params2 +  $item['name'] + '' + $item['value'];
             ?>
    <script src="https://unpkg.com/[email protected]/dist/sweetalert2.all.js"></script>
            <script type="text/javascript">
    				  swal(
    					'LOADING',
    					)
            </script>
    <?php	 
        } 
      
      }

    Just a quick heads up, giuls22 — since we’re not able to provide support for this code, I’m going ahead and closing this ticket.

    This is just to help me quickly see which threads still need attention, so please feel welcome to continue the conversation if you’d like. Thanks! ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Method called when a WP Form is submitted?’ is closed to new replies.