• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.3 Showing alert after post is successfully submitted (shown) on a thread

Hi, I want to display an alert after my post is successfully posted and shown on the thread_view.

I tried these on my quick_reply template :

1. Adding showAlert class for my form

<div class="quickReply message">
    <xen:include template="message_user_info">
        <xen:map from="$visitor" to="$user" />
        <xen:set var="$isQuickReply">1</xen:set>

    <form action="{xen:escape $formAction, false}" method="post" class="showAlert AutoValidator blendedEditor" data-optInOut="OptIn" id="QuickReply">
2. Next, adding a piece of code beneath
$(document).ready(function() {
    $('.showAlert').submit(function() {
The problem is : the script always runs right after the reply button is clicked, no matter whether the post is successfully posted or not while some causes may prevent the post from being shown (i.e. must wait for 20 seconds, etc)

How should I handle this so that the alert will only be shown right after the post submitted has successfully been shown on the thread ?

Thanks :)