Avatar of Overthere
Overthere

asked on 

Problem with Ajax and capturing Data after bign submitted

I have a small snippet of coding that uses  php and ajax.
I have created a Heredoc to capture and post the new posted data to another page.
I added an event, jqGridAddEditAfterSubmit, to my grid component (from phpgrid.com)
and it executes the heredoc but displays "undefined"  from the  alert(postData.CustomerId);
It displays my page me.php with no value in custNum.
I am developing locally, using Windows Pro 7, MS Sql Server, Express 8 and php 5.6
Can anyone help me resolve this problem?

$afterSubmit = <<<AFTERSUBMIT
function (event, status, postData)
{
    console.log(event); 
    console.log(status); 
    console.log(postData);
    alert(postData.CustomerId);
    $.ajax({ url: 'me.php',
        data: {custNum: postData.CustomerId}, 
        type: 'post',
        success: function(output) {
                    alert(output);
                }
        });
}
AFTERSUBMIT;

Open in new window

AJAXjQueryPHP

Avatar of undefined
Last Comment
Overthere

8/22/2022 - Mon