SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict crabby80's Avatar
    Join Date
    May 2007
    Posts
    387
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Problem with Sortable.serialize

    Hi guys

    I seem to be having problems sending serialized data to my ajax script. The following script produces Error: 411 -- Length Required

    Any ideas what this could be?

    PHP Code:
        Sortable.create("column5", {
            
    dropOnEmpty:true,
            
    tag:'div',
            
    containment:["column3","column4","column5"],
            
    constraint:false,
            
    hoverclass:'columns-hover',
            
    handle'handle',
            
    ghostingtrue,
            
    onUpdate: function() {
                new 
    Ajax.Request('ajax_controllers/update_content.php', {
                        
    method:'post',
                        
    parameters: {
                            
    data:Sortable.serialize('column5')
                        },
                        
    onSuccess:handlerFunc,
                        
    onFailure:errFunc
                    
    }
                );
            }        
        }); 
    Any help would be much appreciated

    Thanks in advance

    Crabby

  2. #2
    SitePoint Addict jtrelfa's Avatar
    Join Date
    Oct 2004
    Location
    Troy, Mi
    Posts
    231
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    new Ajax.Request('ajax_controllers/update_content.php', {
                        method:'post',
                        parameters: {
                            data:Sortable.serialize('column5')
                        },
                        onSuccess:handlerFunc,
                        onFailure:errFunc
                    }
                );
    You can't send an object literal in your post - it doesn't translate. Everything has to be a name/value pair 'var1=value&var2=value'

    Try this:
    Code:
    new Ajax.Request('ajax_controllers/update_content.php', {
                        method:'post',
                        parameters:Sortable.serialize('column5'),
                        onSuccess:handlerFunc,
                        onFailure:errFunc
                    }
                );
    http://wiki.script.aculo.us/scriptac...able.serialize
    var me = null;


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •