Preventing multiple submits of the same form
authorAlexander Ebert <ebert@woltlab.com>
Tue, 9 Apr 2013 18:54:02 +0000 (20:54 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 9 Apr 2013 18:54:02 +0000 (20:54 +0200)
templates/conversationAdd.tpl
templates/conversationMessageAdd.tpl
templates/conversationMessageEdit.tpl

index 0a002ddbdcb1828f3be9144df6bdfc5641900cf6..ccb41021c8b49b281d206e638df283f259833cd3 100644 (file)
@@ -12,6 +12,7 @@
                        new WCF.Search.User('#invisibleParticipants', null, false, [ ], true);
                        
                        WCF.Message.Submit.registerButton('text', $('#messageContainer > .formSubmit > input[type=submit]'));
+                       new WCF.Message.FormGuard();
                });
                //]]>
        </script>
@@ -32,7 +33,7 @@
        <p class="error">{lang}wcf.global.form.error{/lang}</p>
 {/if}
 
-<form id="messageContainer" method="post" action="{link controller='ConversationAdd'}{/link}">
+<form id="messageContainer" class="jsFormGuard" method="post" action="{link controller='ConversationAdd'}{/link}">
        <div class="container containerPadding marginTop">
                <fieldset>
                        <legend>{lang}wcf.conversation.information{/lang}</legend>
index b422424bff71fac1aa77fba131c4aeaa6d8dbbd0..687b8f5d8a82de6fc70fa2ffcd82f527cc4c7b9f 100644 (file)
@@ -13,6 +13,7 @@
                        new WCF.Conversation.Message.QuoteHandler($quoteManager);
                        
                        WCF.Message.Submit.registerButton('text', $('#messageContainer > .formSubmit > input[type=submit]'));
+                       new WCF.Message.FormGuard();
                });
                //]]>
        </script>
@@ -33,7 +34,7 @@
        <p class="error">{lang}wcf.global.form.error{/lang}</p>
 {/if}
 
-<form id="messageContainer" method="post" action="{link controller='ConversationMessageAdd' id=$conversationID}{/link}">
+<form id="messageContainer" class="jsFormGuard" method="post" action="{link controller='ConversationMessageAdd' id=$conversationID}{/link}">
        <div class="container containerPadding marginTop">
                <fieldset>
                        <legend>{lang}wcf.conversation.message{/lang}</legend>
index 60a0bf9201ad2f0c2e0eb3de43acc428566c3f0c..8676f3f553944db883654628c084201efbddd511 100644 (file)
@@ -9,6 +9,7 @@
                //<![CDATA[
                $(function() {
                        WCF.Message.Submit.registerButton('text', $('#messageContainer > .formSubmit > input[type=submit]'));
+                       new WCF.Message.FormGuard();
                });
                //]]>
        </script>
@@ -29,7 +30,7 @@
        <p class="error">{lang}wcf.global.form.error{/lang}</p>
 {/if}
 
-<form id="messageContainer" method="post" action="{link controller='ConversationMessageEdit' id=$messageID}{/link}">
+<form id="messageContainer" class="jsFormGuard" method="post" action="{link controller='ConversationMessageEdit' id=$messageID}{/link}">
        <div class="container containerPadding marginTop">
                {if $isFirstMessage}
                        <fieldset>