[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Koha-devel] Disabling multiple submission on search form
From: |
Frédéric Demians |
Subject: |
Re: [Koha-devel] Disabling multiple submission on search form |
Date: |
Thu, 18 Feb 2016 09:13:46 +0100 |
> Some impatient users tends to click several times on the “Go” button of the
> search form on OPAC. Probably in a desperate hope that this will speed up
> the whole process.
> However the result is quite opposite, as Zebra is then queried multiple
> times which increases the server cpu load, until it reach 100% and cause
> Denial of Service (boooh…)
Are you sure your users are doing that? Koha server can lag severely for other
reasons...
> We had the idea of disabling the “searchsubmit” button upon first click.
> This is done by adding onclick=”this.disabled=true;” after “id=searchsubmit”
> in masthead.inc.
Rather than modifying direcly masthead.inc, you could do it with a JavaScript
snippet placed in opacuserjs system preference:
$(document).ready(function() {
$('#searchform').submit(function() {
$('#searchsubmit').prop('disabled',true).text('searching...');
});
});
It could make sense to integrate this to Koha code base: open a bug ticket.