Drupal: .htaccess Access Deny
August 21, 2014 – 7:59 am | No Comment

In this article I will tell how to forbid access to certain resources for some clients. The instructions will include descriptions of different directives.

Read the full story »
CSS Templates

Contain reviews and news about CSS Templates.

Freebies

Contain freebies such as icons, graphics, headers and images for your websites.

Fun Stuff

Contains other fun stuff for entertainment or interesting site showcase.

How-To

Contain technical elaborations on some specific workarounds or common tweak.

Joomla Templates

Contains reviews and news about Joomla templates.

Home » How-To

Drupal: How to Prevent Duplicated Posts

Submitted by on June 6, 2011 – 7:36 amNo Comment

In contrast to Drupal 6, Drupal 5 has no protection from multiple form processing. If a user clicks "Submit" button a few times, duplicated posts will appear.

Solutions

  • Hide buttons once Submit button is clicked

Insert the following code to the end of page.tpl.php template:

$(document).ready(function() {
$(‘input[@type=submit]’).click(function() {
$(this).siblings(‘input[@type=submit]’).hide();
$(this).hide();
$(‘<p class="loading">OK…</p>’).insertAfter(this).slideDown(‘fast’);
})
})

How it works: when Submit button is clicked, all buttons disappears and a user couldn’t click them again.

  • Use Form single module

Download&use this module to prevent duplicated posts: http://drupal.org/project/formsingle

Good luck!

Leave a comment!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.