Disabling submit buttons on click is pretty common nowadays I think, adding the following to the Free Nodelet Settings enables this behavior for the "preview" and "create" buttons (using jQuery). Because disabled buttons don't get included in form submissions, but PerlMonks relies on them, I added a workaround which adds a <input type="hidden" ...>.
<script src="https://code.jquery.com/jquery-3.2.1.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script> <script language="javascript" type="text/javascript"> //<!-- $(document).ready(function() { $("input[type='submit'][name='op'][value='preview'], " +"input[type='submit'][name='op'][value='create']") .click(function() { $(this).prop("disabled",true); $(this).after( $('<input>').attr({ type: 'hidden', name: $(this).attr('name'), value: $(this).attr('value') }) ); }); }); //--> </script>
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: [Free Nodelet Hack] Disable Submit Button on Click
by LanX (Saint) on Mar 25, 2017 at 14:22 UTC | |
by haukex (Archbishop) on Mar 25, 2017 at 15:09 UTC | |
by LanX (Saint) on Mar 25, 2017 at 15:21 UTC | |
by LanX (Saint) on Mar 25, 2017 at 15:22 UTC | |
by haukex (Archbishop) on Mar 25, 2017 at 15:27 UTC | |
| |
by LanX (Saint) on Mar 25, 2017 at 15:21 UTC | |
by LanX (Saint) on Mar 25, 2017 at 15:21 UTC | |
Re: [Free Nodelet Hack] Disable Submit Button on Click
by LanX (Saint) on Mar 25, 2017 at 15:55 UTC |
Back to
Perl Monks Discussion