title: jqGrid afterSubmit
body: <p>I am returning a JSON value called <strong>insertStatus</strong> and I'd like to get it from the function <strong>aftersubmit</strong> which I have as it follows:</p>
  <pre><code>var addOptions = 
        
        { 
            closeOnEscape: true,
            width:500,
            url: 'addMember', 
            savekey: [true, 13],
            afterSubmit : function(response, postdata) 
            { 
                alert(response.insertStatus);
            },
            resize : false,
            closeAfterAdd: true
        };
    
  </code></pre>
  <p>But I will just display the message &quot;undefined&quot;.</p>
  <p>I am trying to get the value of InsertStatus as JSON because this value will tell me if the insert of the new record was successfully saved to the Database or not. Maybe I should follow another approach if I cannot get the JSON value from here?</p>
  <p>I used errorText before for another task and instead of returning a JSON value I returned an HTTP error status with a custom error message. Which would be the best approach? Even if the second approach was better I'd really like to know the answer of the first one. Thanks for your help.</p>