MelusDecus
MelusDecus

Reputation: 81

form submitting inside fancybox

I've just started using fancybox. My client want's a popup box (using fancybox) with a form inside. However, i've created the form, but when i try to hit the "submit" button, nothing happens. It kinda looks like fancybox has a "submit = false" function inside the javascript code.

Dose anybody know what i can do? to make this work?

JS snippet

    $(document).ready(function() {
        $(".various").fancybox({
            maxWidth    : 800,
            maxHeight   : 600,
            fitToView   : false,
            width       : 470,
            height      : 215,
            type        : 'inline',
            autoSize    : false,
            closeClick  : false,
            openEffect  : 'none',
            closeEffect : 'none'
        });
    });

HTML

    <div id="left_profile_menu">
        <ul>
            <li><a class="various" href="#send_message"><img src="<?php echo base_url() . 'public/' ?>img/btn/send_privat_mld.jpg" /></a></li>

            <div id="send_message" style="display:none;">
                <h2>Send melding til <?php echo ucfirst($userdata['username']) ?></h2>
                <?php form_open('message/send/' . $userdata['username']) ?>
                <textarea style="padding: 10px;" rows="7" cols="53"></textarea>
                <input id="send_message_submit" type="submit" value="" />
                </form >
            </div>

            <li><a href="#"><img src="<?php echo base_url() . 'public/' ?>img/btn/legg_til_venn.jpg" /></a></li>
        </ul>
    </div> <!-- end left_profile_menu -->

Upvotes: 0

Views: 3687

Answers (2)

jacktheripper
jacktheripper

Reputation: 14219

You will need to use an <iframe> as is documented here. There are also numerous other questions which answer exactly your question: see here, here, here, or here.

Please also note that you have forgotten the 'echo' in your php.

Upvotes: 0

ori
ori

Reputation: 7847

Forgot the echo? Change this:

<?php form_open('message/send/' . $userdata['username']) ?>

To this:

<?php echo form_open('message/send/' . $userdata['username']) ?>

Upvotes: 1

Related Questions