AJAX change content outside lightbox

I have a lightbox when i open the lightbox i want to click a ajaxbutton or ajaxlink and change content outside the lightbox… in the main page. Is that possible? How can i do?

Thanks.

I mean… update the parent window by ajax link that i have on my lightbox…?

Any help? thanks

I would like to continue this topic here…

I need to update a Div in a Lightbox after pressing a ajax submit button.

Right now my ajax submit button is working fine but its is updating a content outside the lightbox div.

But i need to update a Div inside a lightbox.

Does anybody can help me here…:(

Hi Koz,

I have little bit same issue here.MY content is updating outside the ligthbox as you want.But id want to update a Content inside a lightbox. which is not working. :(.so, if your code is working in the lightbox, so can you please share it with me.

Thanks in Advance.

show me your code from the AjaxLink und the destination!!


     <!-- Start a Photo Gallery Code -->

               <?php


               if(!empty($galleryImages)){

               ?>

               <ul class="gallery clearfix"> <!-- start a code for listing of images-->

               <?php

                $i=1;

                   foreach ($galleryImages as $image):

                       //echo $i;

                    //echo $image->photo_name;

                   ?>

                    <li><a href="#inline_demo<?php echo $i;?>" rel="prettyPhoto[inline]"><?php echo CHtml::image($bUrl."/uploads/gallery/thumb/".$image->photo_name);?></a></li>

                   <?php

                   $i++;

                   endforeach;

                   ?>

                   </ul> <!-- end of Ul Li code -->


                   <!-- this loop is written for Showing a Inline Content Div For a Particuler Div -->

                    <?php

                    $j=1;

                   foreach ($galleryImages as $image):

                       //echo $image->photo_name;

                   ?>


                <div id="inline_demo<?php echo $j;?>" style="display:none;">


                <p><?php echo CHtml::image($bUrl."/uploads/gallery/full/".$image->photo_name);?></p>

               

                   <!-- Start of Comment form -->




                   <?php if(Yii::app()->user->getId()){?>

                    <div class="replyform" id="comment<?php echo $image->id;?>" style="display:">

                        <?php $form=$this->beginWidget('CActiveForm', array(

                        'id'=>'photocommentform'.$image->id,

                        'action'=>CHtml::normalizeUrl(array('/gallery/postcomment')),

                         'enableAjaxValidation'=>true,

                         'enableClientValidation'=>true,

                         'clientOptions'=> array('validateOnSubmit'=>true),

                         'stateful'=>true, 'htmlOptions'=>array('enctype' => 'multipart/form-data'),

                        )); ?>


                           <div class="replyblank" id="errordiv<?php echo $image->id;?>" style="display:none;">

                               Please post your comment.you can not submit blank form.

                           </div>


                            <div class="replycomenreply"><?php echo $form->textArea($model,'comment',array('class'=>'commentreplytext','id'=>'photocomment'.$image->id)); ?></div>

                            <div class="replypostbutton">

                                    <?php echo CHtml::activeHiddenField($model,'photo_id',array('value'=>$image->id));?>

                                    <?php echo CHtml::ajaxSubmitButton('Post',array('gallery/postcomment'), array('update'=> "#commentreplycnt".$image->id,'dataType'=> 'html'),array("class"=>"buttonbgimage"));?>

                            </div>

                         <?php $this->endWidget();?>


                   </div>


                   <?php } ?>

                            <!--Start Listing of Comments-->

                                   <div id="commentreplycnt<?php echo $image->id;?>" class="photo_cmmnts">

                                        <?php

                                             $photoComment = new PhotoComment();

                                             $photoCommentData = $photoComment->photoCommentFetch($image->id);


                                       if($photoCommentData){

                                            foreach($photoCommentData as $photoCommentData){

                                        ?>

                                        <div  class="photocommentdetail">

                                            <div class="fwidth">

                                                 <div class="bpicholder">

                                                        <?php

                                                        if(!empty($photoCommentData->usetInfo->userpic)){

                                                            echo CHtml::image($bUrl.'/uploads/user_avatar/thumb/'.$photoCommentData->usetInfo->userpic,"",array("width"=>"30","height"=>"30"));

                                                        }else{

                                                            echo CHtml::image($tUrl.'/images/no_img.jpg',"",array("width"=>"30","height"=>"30"));

                                                        }?>

                                                 </div>

                                                 <div class="blog_post_name">

                                                        <span><?php echo $photoCommentData->usetInfo->first_name;?> </span>

                                                        &nbsp; <?php echo $photoCommentData->comment;?>

                                                 </div>

                                                 <div class="blog_post_name">

                                                         <span>Posted on <?php echo date('M d, Y H:i a',strtotime($photoCommentData->created));?>

                                                         &nbsp;</span>

                                                 </div>

                                            </div>

                                        </div>

                                    <?php }}?>


                        </div>





                    <!-- End of Commnet form -->

                </div>

                   <?php

                   $j++;

                   endforeach;

               }else{

                   echo "There Is No Image in this Gallery";

               }

               ?>

               <!-- End of Photo galleyry Code -->




This is my code.

I am creating a Image gallery.When a user click on any photo it will open in Lightbox and User can comment on it.

And the listed comment will show there.

Everything is working fine here…But i got two Bugs Here.

1, I am not able to validate a post form.

  1. Comment listing Div is not updating with Ajax on Post.