• Resolved jpakin

    (@jpakin)


    On this form, if we click the submit button directly after entering text in the box, the values (from the db lookup) are not passed along to the next form.

    Any other actions between filling in the text field and clicking the button result in a proper lookup.

    Is it possible the form doesn’t have time to look up the values before it submits (race condition)? Is there a way to force the lookup prior to the form submitting?

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @jpakin,

    I’m sorry, but we cannot continue offering a support service for the Developer version of the plugin through the forum of ww.wp.xz.cn

    If you have additional questions, please contact me through my private website:

    https://cff.dwbooster.com/contact-us

    Furthermore, I recommend you visit the webpage with the support policies:

    https://cff.dwbooster.com/support-policy

    Best regards.

    Thread Starter jpakin

    (@jpakin)

    Please don’t take this the wrong way, but I’m not going to pay for support for an edge case you didn’t consider/race condition of your creation. If anyone comes across this, I solved the problem as follows. Dev, if I’m wrong about this, feel free to correct me.

    <script>
    (function ($) {
    $(document).ready(function () {
    //hijack cff inline binding
    var form = $(‘form’), oldSubmit = form[0].onsubmit;
    form[0].onsubmit = null;
    //new binding
    form.submit(function() {
    //trigger a doc change, which will fire xhr in the plugin
    $(‘document’).trigger(‘change’);
    //when everyone is finished (DB calls retrieved), call the old binding
    $(document).ajaxStop(function() {
    oldSubmit.call(this);
    });
    });
    });
    })(jQuery);
    </script>

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Race Condition with submit?’ is closed to new replies.