Solving the Double Submission Issue

Real life situation: placing bets on a betting website. Users would double click and get two bets placed. Not good! Javascript checks were not sufficient to prevent this. Solution: Create UUID/GUID hidden input in form using server-side scripting language that renders the form. On form submission immediately add this to a database table called UniqueSubmissions … Read more

How to do double-click prevention in JSF

If you’re using solely ajax requests, you could use jsf.ajax.addOnEvent handler of the JSF JavaScript API for this. The below example will apply on all buttons of type=”submit”. function handleDisableButton(data) { if (data.source.type != “submit”) { return; } switch (data.status) { case “begin”: data.source.disabled = true; break; case “complete”: data.source.disabled = false; break; } } … Read more