I'm learning all about cakephp but having an issue which I can't
figure out. I'm trying to have a file upload form inside a modal box,
but although the form works fine when not in a modal box and just in a
ctp file, when it's in the modal box it doesn't submit at all.

I'm using Uploader by Miles Johnson 
http://milesj.me/code/cakephp/uploader#script
and the modal box is from http://nyromodal.nyrodev.com/

The code I'm using to create the form is:
<a href="#test" class="nyroModal"><?php echo $this->Html-
>image('uploadimage.gif');?></a>
<div id="test" style="display: none; width: 600px;">    <?php
    echo $form->create('Image', array('action'=>'upload', 'type' =>
'file'));
    echo $form->input('fileName', array('type' => 'file'));
    echo $form->end('Upload');
</div>

When I click the image the modal box pops up as expected with the form
inside just like it's meant to be. But when I click submit nothing
happens.

Like I said, the exact same form works outside the modal box. Plus the
outputted code appears the same:
<form id="ImageUploadForm" enctype="multipart/form-data" method="post"
action="/sponster/images/upload" accept-charset="utf-8">
    <div style="display:none;">
        <input type="hidden" name="_method" value="POST" />
    </div>
    <div class="input file">
        <label for="ImageFileName">File Name</label>
        <input type="file" name="data[Image][fileName]"
id="ImageFileName" />
    </div>
    <div class="submit"><input type="submit" value="Upload" />
    </div>
</form>

I've obviously missed something stupid or something? Can anyone help
me please?

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to