1

I have an issue with Gravity forms. I successfully loaded Gravity Forms via ajax, but I got an error of 400 when I submit the form.

I tried all solutions but still can't submit the forms.

here is my ajax code

var data = {
            action': 'step_3_ajax_content',
            }
$.ajax({
        type: "POST",
        url: ajax.url,
        data: data,
        beforeSend: function() {
        $(".loading").show();
        },
            success: function(response) {
                $('.wizards-content-ajax').html(response);
                 $(".loading").hide();
        }
 });

to show forms I use shortcode

<?php echo do_shortcode( '[gravityform id="1" title="false" description="false" ajax="true"]' ); ?>

I get error /wp-admin/admin-ajax.php#gf_1:1

in my header gravity_form_enqueue_scripts (1, true); // Ajaxed form id = 1

2
  • Did you ever find a solution for this? We have run into the same issue today. Apr 28, 2022 at 5:25
  • you need to ask Gravity forms support or in a GF community, 3rd party plugin user/dev support questions questions are offtopic here andnot in this stacks scope
    – Tom J Nowell
    Sep 26, 2022 at 17:22

1 Answer 1

0

facing the same issue..., i'm try to to load the form with dynamic content,i was able to load the content and the form but was unable to submit the form. In network tab is shows as Bad Request enter image description here

enter image description here

I suggest reason is....it is unable to fire the gravity ajax action hook

3
  • i just solve the issue by setting the form action to blank... your form probably have the action set to action="/wp-admin/admin-ajax.php#gf_1" like this...! just remove it using js or jquery jQuery('your_gf_id').attr('action', '') Sep 26, 2022 at 18:13
  • This does not really answer the question. If you have a different question, you can ask it by clicking Ask Question. To get notified when this question gets new answers, you can follow this question. Once you have enough reputation, you can also add a bounty to draw more attention to this question. - From Review
    – cjbj
    Sep 28, 2022 at 16:05
  • roshan moolya's suggestion of removing the 'action' property on the form works for me. Jun 14, 2023 at 19:36

Not the answer you're looking for? Browse other questions tagged or ask your own question.