Form Server Response


I’m trying to return the form id of the inserted record and not getting any response. My server code saves correctly and I have the following function:

function responseXML($action){
global $form;
$id = $action->get_id();

    echo "<data><action type='inserted' sid='".$id."' tid='".$id."' /></data>";


$form->event->attach(“afterProcessing”, “responseXML”);

On the client side, I have:

dp_form.attachEvent(“onAfterUpdateFinish”,function(loader){ alert(loader.xmlDoc.responseText);

When I click button, it saves but I get no xml response for me to see record id.

Appreciate if you can please assist.

I’m not quite sure why you are otputing your custom XML instead of the default one ( connector will generate xml response automatically )

Anyway, if you wish to have your custom response, you need to add

echo “”;
die(); //must be added

if process is not stopped, connector will block and ignore all “echo” generated response.

Hi Stanislav,

Thanks for your response. The reason is that when I do a, I’m trying to find a way to retrieve the record id for new inserted record and set it equal to a variable to perform other functions per the following unanswered post of mine:


For some reason the below didn’t work, is there a better way to get the record Id per the above posted link?


Hi Stanislav,

Poking around, I think I got it sorted with this code:


per … savingform

If there’s anything else further to consider, please let me know.