ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

SAEFs with file uploads in a modalbox

July 20, 2010 9:28pm

Subscribe [1]
  • #1 / Jul 20, 2010 9:28pm

    Tyssen

    756 posts

    Has anyone used a SAEF with nGen/MX Univeral Editor to upload images via a modalbox? I’ve got something in place at the moment, but have two problems:

    1. After submitting the form, the page that you get returned to gets loaded inside the modalbox (I’m using Fancybox for jQuery), so you have one version of the page loaded into a modalbox over the same page.
    2. The entry gets created, but the image doesn’t get uploaded. The same form submitted on the page, rather than via the modalbox works OK though.

    The code which I took from the Fancybox website looks like:

    $(".fancy a").fancybox({
        'scrolling' : 'no',
        'titleShow' : false,
        'onClosed' : function() {
            $("#error").hide();
        }
    });
    
    $("#entryform").bind("submit", function() {
    
        if ($("#title").val().length < 1) {
            $("#error").show();
            $.fancybox.resize();
            return false;
        }
    
        $.fancybox.showActivity();
    
        $.ajax({
            type    : "POST",
            cache    : false,
            url        : "/page-the-form-is-on/",
            data        : $(this).serializeArray(),
            success: function(data) {
                $.fancybox(data);
            }
        });
    
        return false;
    });
.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases