How about using .one() <http://api.jquery.com/one/>, which binds an event
handler which can only be run once per element?

Might need to be called upon rendering the form snippet rather than on
loading the main page though (.live() binds event handlers to elements that
don't exist on the page yet).


On 8 August 2013 16:41, Sarah Bird <notifications@github.com> wrote:

> In django/econsensus/publicweb/static/js/clickonce.js:
>
> > @@ -0,0 +1,9 @@
> > +/*
> > +Disables an element (e.g. submit button) of
> > +the "once" class the first time it is clicked
> > +*/
> > +$(document).ready(function() {
> > +    $(".once").live("click", function(e) {
>
> But not until 1.7 and we're using 1.6. Will merge.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/aptivate/econsensus/pull/139/files#r5660992>
> .
>