php - Form submit not displaying message -


i have html form id of newticket , jquery in head section of page:

<script type="text/javascript">     $(document).ready(function(){         $("#message").hide();         $("#newticket").submit(function(e){             e.preventdefault();             datastring=$("#newticket").serialize();             $.ajax({                 type: "post",                 url: "newticket_go.php",                 cache: false,                 data: datastring,                 success: function(res){                     //$("#message").show();                     $("#message").html(res);                     $('#message').fadein('slow');                     if(res.indexof("success")!=-1)                     {                         window.location.href = res.substr(8);                     }                 }             });         });     }); </script> 

i have <div id="message" class="messagebox"></div> above form display message once form has been submitted.

my form looks this:

<form action="newticket.php" method="post" id="newticket" name="form1"> 

the newticket_go.php file works fine runs sql query fine etc. there text echoing in newticket_go.php should display in message div nothing displaying.

any ideas?


Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

VBA function to include CDATA -