Forums

Submitting comments within a facebox window (2 posts)

  1. pacothelovetaco
    Member
    Posted 8 months ago #

    I am using facebox to show my posts, comments, fields and all. The problem I am having is whenever a comment is submitted through the facebox window, the page is redirected to a new page with the new comment. What I want is all of that to happen withing the facebox window.

    I'm new to Ajax. I was trying to run the process through Ajax and then replace the facbox content with the new content. This is what I was trying:

    function submit_form (){
       $.ajax({
       type:'post',
       url:"<?php echo site_url( '/wp-comments-post.php' ); ?>",
       data:$('form#commentform').serialize(),
       success:function(data){
    	//put the returned html into into a facebox popup
    	$('#facebox .content').empty();
            $('#facebox .content').html(data);
    	}
        });
    };

    Then updated the comment-template.php accordingly. Any thoughts? I hit a brick wall.

  2. pacothelovetaco
    Member
    Posted 8 months ago #

    Nothing?

Reply

You must log in to post.

About this Topic

Tags