How can I view jquery success message after the form submit in php?
<p>I want to view a jquery success message after the form submit in php. I tried following code. But its not appearing. But when I code it in html it is working.But it is not after submiting. How can I achieve it?</p>

<p>here is my javascript code in php</p>

<pre><code>    &lt;?php
         if(isset($_POST['aaa']) and $_POST['aaa']=="Submit"){
    echo '&lt;html&gt;
    &lt;style type="text/css" media="screen"&gt;
&lt;!--
.container {width: 670px; margin: 10px auto;}
.messagebox {background-color: #F5F5F5;padding:5px;margin:10px 0px;border: 1px solid #DBDBDB;}
.errorbox {color:#000;background-color:#ffeded;padding:5px;margin:10px 0px;border:1px solid #f27c7c;}
.confirmbox {background-color:#F2FFDB;color:#151515;border:1px solid #9C6;margin:10px 0px;padding:5px;}
--&gt;
&lt;/style&gt;
&lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"&gt;&lt;/script&gt;
&lt;script &gt;
&lt;!--
$(document).ready(function() {
$("#messageBox").addClass("messagebox");setTimeout(function(){
$("#messageBox").fadeOut("slow")}, 4000);
});
function messagebox(){
$("#messageBox").removeClass().addClass("confirmbox").html("Item has been saved").fadeIn(2000).fadeOut(4000);
}
function alertbox(){
$("#messageBox").removeClass().addClass("errorbox").html("Oops, there was an error!").fadeIn(2000).fadeOut(4000);
}
--&gt;

messagebox();
&lt;/script&gt;
&lt;body&gt;
    &lt;div class="messagebox" id="messageBox" style="display:none;"&gt;&lt;/div&gt;
    &lt;/body&gt;
    &lt;/html&gt;';
    }
?&gt;
</code></pre>
