I have a comment window that opens up in a small jqmodal window. I am trying to use $.ajax to submit the form and show "success" in the small modal window. but in all browsers except firefox, the modal closes when I submit the form.
<script type="text/javascript">
$().ready(function() {
$('.reportForm').submit( function(){
if (document.rForm.comment.value != "") {
$('.reportForm').hide();
$.ajax({
type: "POST",
url: "<?php echo $_SERVER["PHP_SELF"]; ?>?c=<?php echo $c; ?>",
cache: false,
data: "comment=" + document.rForm.comment.value,
success: function(html){
$("#results").append(<?php echo get_option('ddrc_success'); ?> + " ");
}
});
return false;
}
});
});
fs