Gravity forms - how not to hide a field on AJAX Submit?
Use this hook in functions.php
:
add_filter( 'gform_confirmation_FORMID', 'gravityforms_custom_confirmation', 10, 4 );
// change FORMID to your gravity form ID
function gravityforms_custom_confirmation( $confirmation, $form, $entry, $ajax ) {
// intentionally do nothing
}
This code makes sure there is no redirect, confirmation or anything else to send. Conversely, you can process $ _POST values ββin one page after submission.
Normal submission of work. However, I have not tested ajax="true"
.
source to share
Displaying a confirmation form can be confusing for the user; however, you can provide a shortcode for the form to submit the form. I have never tested this including the same form in my own validation.
Another alternative is to use the GP Reload Form plugin ( demo ). This allows the user to reload the submitted form for multiple views without refreshing the page. It also supports automatic updating of the form after X seconds, so the user sees the confirmation and then reloads the form.
Disclaimer: GP Reload Form is my own plugin.
source to share