Capture Form Data Using External URL for Form Action

We are currently overriding the standard GF form action with an external URL, to which our various form fields are posted. This works fine, but as it completely bypasses the GF form processing, it doesn’t save a copy of the form submission and doesn’t send any form notifications. Does anyone know of a way of capturing the form data so it can be sent to an email address after the form action has posted the data (or even just before if that’s easier)?

This is the code we’re currently using:

add_filter( 'gform_form_tag', 'form_tag', 10, 2 );
function form_tag( $form_tag, $form ) {
	if ( $form['id'] = 1 ) {
		$form_tag = preg_replace( "|action='(.*?)'|", "action=''", $form_tag );
		return $form_tag;
    else {
        return $form_tag;

If you use the gform_form_tag filter to override the form action, Gravity Forms no longer validates or processes the submission, as you have found.

It is usually preferable to let Gravity Forms perform the validation and handle the submission, then send the data wherever you need using the gform_after_submission hook or the Webhooks Add-On. Are either of those an option for you?

Thanks for the feedback. I think you’re right, it’s going to be a lot easier to rework this using one of those methods than it is to keep struggling on with the current setup. I’ll take a look into them - thanks.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.