Custom Confirmation Anchor Tag [RESOLVED]

Is it possible to use this:
add_filter( ‘gform_confirmation_anchor_1’ , ‘__return_true’);

but have it use a custom tag, instead of the default #gf_1 ?
I tried something like this, similar to jumping to pixles on ajax forms. But no dice.

add_filter( ‘gform_confirmation_anchor_1’, function() {
return ‘#customtag’;
} );

Thanks for any help you can provide.

The gform_confirmation_anchor_{form_id} filter accepts true, false or numeric values. So setting a custom ID through it, indeed won’t work.

However, you could set it to false and use gform_register_init_scripts to register custom javascript / jQuery to get the end result you want :slight_smile:

1 Like

Thanks Hiranthi.

I was able to utilize jQuery to get what I needed. My form is in a Colorbox overlay (Inline HTML) so I needed it to scroll to the top of that popup upon submit to see any error message.

Here is what I came up with.
('#gform_submit_button_1').click(function() { (’#cboxLoadedContent’).animate({scrollTop: 1}, ‘slow’);
});

This might help someone else.
Thanks.:smiley:

2 Likes