We Recommend

HTML: The Definitive Guide HTML: The Definitive Guide
They teach you that learning HTML is like learning any other language and that reading a book of rules can only take you so far. Readers begin writing what may be their first Web page just two pages into the book's second chapter. From there on, they provide a wide range of HTML coding to allow readers to learn from good examples. The book includes a handy "cheat sheet" of HTML codes for quick reference.


Posted By

fackz on 06/04/09


Tagged


Versions (?)


Who likes this?

3 people have marked this snippet as a favorite

fackz
ecardoza
kitzelh


Preventing multiple page requests after double-clicks


Published in: HTML 


To prevent multiple clicks from sending more than one request, you can use a JavaScript that does up to two things: first, you can use the “return false;” function of a hyperlink or submit button to prevent any click after the first from sending a request, and second, you can change the link or button to a disabled state so that the browser won’t accept clicks and the user can see that a request has already been sent.

  1. <input type="submit" name="save" value="Save" onclick="this.form.submit(); this.disabled = 1;" />

Report this snippet 

You need to login to post a comment.