This is more of a Javascript question, but I have used similar code
when working with PHP backends and haven't had problems. Active4D is
responding with a 400 Bad Request.

I'm using the following JS function to submit a POST xmlHTTPRequest
to Active4D. I've removed some code for illustration purposes, but
have tested with code below and it fails too.

I suspect that Active4D doesn't like how formdata is formatted. Here
is an example formdata value that fails:

|short_name_menu=NOAA&short_name=NOAA&full_name=National+Oceanic+and+Atmospheric+Administration&url=http||%3A%2F%2Fwww.noaa.gov&assoc_natl_lab_acronym=&id=1001&version=1&last_update_by=Brad
Perkins|

Note this function is part of a JS object

/**
 * submitForm
 * Submits an already validated form
 */
submitForm: function() {
  
    var formdata;
    formdata  = $("#collaborator_choice_mgmt").serialize();
    formdata += '&id='             + Collaborator.data.id;
    formdata += '&version='        + Collaborator.data.version;
    formdata += '&last_update_by=' + Collaborator.data.last_update_by;
  
    $.post('/ajax/iopr/collab-submit.a4d', formdata,
        function(data){
            if(data.status == false) {
                // handle errors
            }
            if(data.status == true) {
                // OK
            }
        },
        'json'
    );
}

Any ideas?

-- Brad Perkins
_______________________________________________
Active4D-dev mailing list
[email protected]
http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev
Archives: http://mailman.aparajitaworld.com/archive/active4d-dev/

Reply via email to