hi everyone,

what my site does: user clicks on a link in my view and a css popup
(for entering data) opens. there he can upload an image. when he
closes the popup i want this div to refresh, so the uploaded image
will be shown.

currenty i need to manually refresh the whole page with F5. so
somehow, i need to tell cake, when the popup is closed, it has to
refresh this particular DIV.

so all of the following code is in my view:
the JS-syntax that handles opening and closing the css-popup (i took
some code out to make it clearly)

$(document).ready(function() {

        //When you click on a link with class of poplight and the href starts
with a #
        $('a.poplight[href^=#]').click(function() {
            var popID = $(this).attr('rel'); //Get Popup Name
            var popURL = $(this).attr('href'); //Get Popup href to define
size


            //Fade in the Popup and add close button
            $('#' + popID).fadeIn().css({ 'width':
Number( popWidth ) }).prepend('<a href="#" class="close"><img src="../
img/icons/close.png" class="btn_close" title="Close Window"
alt="Close"  /></a>');

        //Close Popups and Fade Layer
        $('a.close, #fade').live('click', function() { //When clicking on the
close or fade layer...
            $('#fade , .popup_block').fadeOut(function() {
                $('#fade, a.close').remove();  //fade them both out
            });
            return false;

        });

});


ok, now the form that appears in my CSS popup, for uploading an image

<div id="popup_flyer" class="popup_block">
<form id="popup_flyer" method="post" action="/muh/abc/processFlyer"
accept-charset="utf-8">
        <div class="row">
                <div class="popup_title">Flyer/Logo hochladen</div>

                                <?php
                                echo $form->create('abc',
array('name'=>'uploadProfileImageForm','id'=>'uploadProfileImageForm','type'=>'file'));
                                echo $form->file('abc');
                                ?>
                                <button
onClick="ajaxUpload(this.form,'processFlyer','flyer_css','&lt;br /
&gt;&lt;img src=\'../img/icons/loader.gif\' width=\'16\' height=\'16\'
border=\'0\' /&gt;','Fehler beim Upload'); return false;"
type="button">Hochladen</button>
                                <?php
                                echo $form->end();
                                ?>

                                <div id="flyer_css">
                                </div>

                <div id="msgbox" style="display:none"></div>
        </div>
</form>
</div>


last but not least: my div where the picture needs to be shown:
                                        <div id="flyer_preview"></div>
                                        <?php echo 
$html->image($linkables_flyer_path_temp); ?>
                                        </div>


so how do i do it? it seems JS is the best solution here. but i am
having trouble, because i wanna refresh this DIV by closing a popup..

looking forward to your feedback :)

big thx

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to