views:

27

answers:

0

Hi all,

I'm not sure what this error means: 'ManagementForm data is missing or has been tampered with'.

I have the following database schema, i have a task database, and then i can assign a task to another user as desired, so i have a user field with foreignkey pointing to User. Now, in the admin panel, i can add another user from the adding task window, with a little plus to the side. If i click on that, the default behavior is to popup a new window to add. However, i don't want that, so i used fancybox to override the .add-another link to popup a fancybox instead, with the following code:

$('a.add-another').removeAttr('onClick').each(function(){
    var href = $(this).attr('href');
    if (href.indexOf('?') == -1) {
        href += '?_popup=1';
    } else {
        href  += '&_popup=1';
    }
    $(this).attr('href', href);
}).fancybox();

The default onclick function is as follows (the function responsible for the original popup):

function showAddAnotherPopup(triggeringLink) {
    var name = triggeringLink.id.replace(/^add_/, '');
    name = id_to_windowname(name);
    href = triggeringLink.href
    if (href.indexOf('?') == -1) {
        href += '?_popup=1';
    } else {
        href  += '&_popup=1';
    }
    var win = window.open(href, name, 'height=500,width=800,resizable=yes,scrollbars=yes');
    win.focus();
    return false;
}

If i use the original function it works, if i don't, i get that error. Anyone knows of a solution?

EDIT: So i just changed fancybox's type to iframe, it displays fine, also inserts fine (without that error). However, i have another error where it calls opener.dismissAddAnotherPopup(..). Since i opened it in iframe, it doesn't have opener set. So it returns error and never closes the iframe and refresh the page. Anyone know of any solutions? Thanks a lot!