Disable button on submit (v9)

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
Adam
User
Posts: 480

Disable button on submit (v9)

Post by Adam »

I'm not sure if this is a problem, or just how the feature is implemented...

I've just added a Multi-Update feature that allows records to be updated in batches of up to 500.

I've noticed that, with a large batch, the submit button remains clickable... right up to the point that the list page is re-displayed.

I assumed that the button would be disabled with JS or jQuery so I'm not quite sure what to make of this.

Is it a problem or is the "disabling" being handled another way?


danielc
User
Posts: 1601

Post by danielc »

Have you enable [Tools]->[Advanced Setting]-> [Disable button on submit] option? What PHPMaker version you are using?

You can search for "//Submit" in ewp*.js to see the code.


lhardee
User
Posts: 36

Post by lhardee »

Hi Adam,

I had this problem as well.....another way to handle this in addition to what the Webmaster has provided is the following:

At the bottom of my add/edit page, i place the following javascript

<script type="text/javascript">
$(document).ready(function() {
// bind to on submit event
$('form').bind('submit', function(e) {
// disable any input buttons
$(this).find('input:submit').attr('disabled', 'disabled');
// after 3 seconds, renable them, should give enough time to submit as normal
setTimeout( function() {
$('form').find('input:submit').removeAttr('disabled');
}, 50000);
});
});
</script>

This works nicely because if the user needs to hit submit again, you can adjust the time (50000), which will make the submit button clickable again.

Hope this helps!!!

lhardee


Adam
User
Posts: 480

Post by Adam »

Thanks for that - yeah... I did have the option set in advanced settings (running 9.20) but this is an especially ong process (or can be) so I just need to disable the button and wait for the page to refresh.


Post Reply