WordPress.org

Ready to get started?Download WordPress

Forums

WP Max Submit Protect
[resolved] doesnt really work it seems (11 posts)

  1. ollybach
    Member
    Posted 5 months ago #

    WP 3.8.1

    the idea is good but i just get these errors in the console and it doesnt stop me from submitting although i - deliberately set the max_input_vars to 50 to see what happens (obviously on a development installation)...

    Uncaught SyntaxError: Unexpected token = jquery.maxsubmit.js:44
    Uncaught TypeError: Object [object Object] has no method 'maxSubmit'

    https://wordpress.org/plugins/wp-max-submit-protect/

  2. ollybach
    Member
    Posted 5 months ago #

    btw, this is a virgin install of WP 3.8.1, no other plugin installed but this one and it just throws js errors

  3. Jason Judge
    Member
    Plugin Author

    Posted 5 months ago #

    Olly,

    Sorry - I don't get notifications of new support requests, so have only only just seen this.

    I'll check this out now and see what the problem could be.

  4. Jason Judge
    Member
    Plugin Author

    Posted 5 months ago #

    I'm guessing you have something like this around line 44 of your source page, where the JS error is being invoked:

    <script type="text/javascript">
    /* Plugin: WP Max Submit Protect */
    jQuery(document).ready(function($) {
    $('form').maxSubmit({
    max_count: 2000,
    max_exceeded_message: "This form has too many fields ({form_count}) for the server to accept (max {max_count})\nData may be lost if you submit. Are you sure you want to go ahead?"
    });
    })
    </script>

    Higher up in the header, you should have the JS library included:

    <script type='text/javascript' src='http://exmaple.co.uk/wp-content/plugins/wp-max-submit-protect/js/jquery-maxsubmit/jquery.maxsubmit.js?ver=1.0.5'></script>

    Either it is missing, or they are the wrong way around, or maybe jQuery is not being loaded early enough?

    It works find for my on a multi-site and several single sites. However, I'll try a fresh 3.8.1 in case it is other plugins I have installed that are helping to change the order JS is loaded.

  5. ollybach
    Member
    Posted 5 months ago #

    Hey
    no worries.
    I just messed around with things and came across that one and thought I pass it on
    (chrome btw)

  6. Jason Judge
    Member
    Plugin Author

    Posted 5 months ago #

    Just installed a fresh 3.8.1 on PHP 5.3 and the plugin. No JS errors so far. Is there anything more you can tell me about your site, or do you have a link you could send me?

    I'll try Chrome too.

  7. ollybach
    Member
    Posted 5 months ago #

    it was all on localhost, so cant really send you a link (and i have since done a ton of other things here)

    if you want, i can flatten this install (i do that all the time anyway to test my own plugins) and see if i can reproduce it again ?!

  8. Jason Judge
    Member
    Plugin Author

    Posted 5 months ago #

    I found a syntax error in the JS that was throwing Chrome out, but which Firefox was simply ignoring. I've fixed that in this plugin (version 1.0.6 now released) and also in the underlying jQuery plugin (https://github.com/judgej/jquery-maxsubmit and http://plugins.jquery.com/jquery-maxsubmit/).

    Thanks for your help - I must remember to test against a wider range of browsers.

    If this works for you, please feel free to close this ticket.

  9. ollybach
    Member
    Posted 5 months ago #

    resolved as far as i'm concerned. i dont really need this plugin (not at the moment anyway)

    i only had someone else install it to see what happens who then - in turn - said it all went wrong / didnt work, so I just installed it as mentioned above and got those errors which I thought I might as well just pass on.

    > re: I must remember to test against a wider range of browsers.

    bane of our lives i would have thought :).....
    wouldnt it be nice if they would all do the same thing the same way..?
    (most likely never gonna happen though ...ho hum)

  10. Jason Judge
    Member
    Plugin Author

    Posted 5 months ago #

    Cool. Well thanks again for spending the time to report this. Knowing something is not working is always the first important step to being able to fix it :-) Automated testing for WP is a little more difficult than a library or standalone piece of code.

  11. ollybach
    Member
    Posted 5 months ago #

    > Automated testing for WP is a little more difficult than a library or standalone piece of code.

    isn't that the truth.....:)

  12. ollybach
    Member
    Posted 5 months ago #

    > Automated testing for WP is a little more difficult than a library or standalone piece of code.

    isn't that the truth.....:)

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.