]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Fixes #2522 - disabling form submission after first submission
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Tue, 12 Oct 2010 12:02:00 +0000 (12:02 +0000)
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Tue, 12 Oct 2010 12:02:00 +0000 (12:02 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@7065 36083f99-b078-4883-b0ff-0f9b5a30f544

views/installation/input/button.php
views/installation/input/form.php
views/installation/install/forms/admin.php
views/installation/install/forms/database.php
views/installation/install/forms/settings.php
views/installation/install/forms/template.php
views/installation/install/nav.php

index 2c36841df9e582c2edaf07d4f351a71ebc845af7..cc6a236c0e145139e120612ee754232ad5dda61a 100644 (file)
@@ -50,4 +50,4 @@ if (strpos($src,$CONFIG->wwwroot)===false) {
        $src = "";
 }
 ?>
-<input type="<?php echo $type; ?>" class="<?php echo $type; ?>_button" <?php echo $vars['js']; ?> value="<?php echo $value; ?>" src="<?php echo $src; ?>" class="<?php echo $class; ?>" />
\ No newline at end of file
+<input type="<?php echo $type; ?>" <?php if (isset($vars['internalid'])) echo "id=\"{$vars['internalid']}\"";?> <?php echo $vars['js']; ?> value="<?php echo $value; ?>" src="<?php echo $src; ?>" class="<?php echo $class; ?>" />
\ No newline at end of file
index 35e718adb84929e2465c9c1dc36db3ba3f9b3eb1..d17a913f47222edee7f995ea4590409cb2cedf8f 100644 (file)
@@ -47,7 +47,7 @@ if (!isset($vars['disable_security']) || $vars['disable_security'] != true) {
        $security_header = elgg_view('input/securitytoken');
 }
 ?>
-<form <?php if ($id) { ?>id="<?php echo $id; ?>" <?php } ?> <?php if ($name) { ?>name="<?php echo $name; ?>" <?php } ?> action="<?php echo $action; ?>" method="<?php echo $method; ?>" <?php if ($enctype!="") echo "enctype=\"$enctype\""; ?>>
+<form <?php if ($id) { ?>id="<?php echo $id; ?>" <?php } ?> <?php if ($name) { ?>name="<?php echo $name; ?>" <?php } ?> action="<?php echo $action; ?>" method="<?php echo $method; ?>" <?php if ($enctype!="") echo "enctype=\"$enctype\""; ?> <?php echo $vars['js']; ?>>
 <?php echo $security_header; ?>
 <?php echo $body; ?>
 </form>
\ No newline at end of file
index ae83cadea735cc438c0493ef2554173836bb560d..cfeab190a7b7ff32c4afcab0db367420d2819808 100644 (file)
@@ -17,5 +17,6 @@ $params = array(
        'body' => $form_body,
        'action' => $url,
        'disable_security' => TRUE,
+       'js' => 'onsubmit="return elggCheckFormSubmission()"',
 );
 echo elgg_view('input/form', $params);
index a3fa8dd6574e61ae6a161c4348568a6c2933165c..2d1d41bc9d0af2a5b70c60e2440723e3593a5afb 100644 (file)
@@ -16,5 +16,6 @@ $params = array(
        'body' => $form_body,
        'action' => $url,
        'disable_security' => TRUE,
+       'js' => 'onsubmit="return elggCheckFormSubmission()"',
 );
 echo elgg_view('input/form', $params);
index 67cba10f629f98b08a239610e4a2250c0e282e3c..7f493ebff0f11b935d2d3b405f9568089693b6c2 100644 (file)
@@ -16,5 +16,6 @@ $params = array(
        'body' => $form_body,
        'action' => $url,
        'disable_security' => TRUE,
+       'js' => 'onsubmit="return elggCheckFormSubmission()"',
 );
 echo elgg_view('input/form', $params);
index 98cdcadabbff6c4969073efbc6e6a8636ccedb6c..c3f70d76825211b1179093936b6cd8dee864d43e 100644 (file)
@@ -22,6 +22,21 @@ foreach ($variables as $field => $params) {
        $form_body .= '</p>';
 }
 
-$form_body .= elgg_view('input/submit', array('value' => elgg_echo('next')));
+$submit_params = array(
+       'value' => elgg_echo('next'),
+);
+$form_body .= elgg_view('input/submit', $submit_params);
 
 echo $form_body;
+
+?>
+<script type="text/javascript">
+       var was_submitted = false;
+       function elggCheckFormSubmission() {
+               if (was_submitted == false) {
+                       was_submitted = true;
+                       return true;
+               }
+               return false;
+       }
+</script>
index d6a20ea2bce8a9a14a7b84c8a5cc5241a355b83d..ca4b8a87b8f2c4f1eb72e0893aaefcdff8c2e866 100644 (file)
@@ -19,7 +19,7 @@ if (isset($vars['refresh']) && $vars['refresh']) {
 // create next button and selectively disable
 $next_text = elgg_echo('next');
 $next_link = "{$vars['url']}install.php?step={$vars['next_step']}";
-$next = "<a href=\"$next_link\" disable=\"disable\">$next_text</a>";
+$next = "<a href=\"$next_link\">$next_text</a>";
 if (isset($vars['advance']) && !$vars['advance']) {
        // disable the next button
        $next = "<a class=\"disabled\">$next_text</a>";