<p>According to <a href="https://github.com/pixelandtonic/GuestEntries/blob/master/README.md" rel="nofollow noreferrer">the README</a>, the Guest Entries plugin accepts an AJAX request, and returns an object containing the entry ID, title, and so forth.</p>

<p>As such, if you're <a href="http://api.jquery.com/jquery.ajax/" rel="nofollow noreferrer">using jQuery</a>, you should be able to do something like this (not tested):</p>

<pre><code>$.ajax({
    data: $('#theform').serialize(),
    method: 'POST',
    done: function (data) {
        // The entry title.
        console.log(data.title);
    }
});
</code></pre>

<p>I'm not sure how Guest Entries handles errors, so you'll probably want to check the <code>data.success</code> property, before proceeding.</p>

CC BY-SA 3.0
2017-04-16T11:56:21.583Z
I've ended up calling for entry's data with jQuery `response` function and so on as you've indicated for checking errors. That worked well!
Dominik Krulak
CC BY-SA 3.0
2017-04-15T18:54:04.897Z
2017-04-15T18:54:04.897Z
Stephen Lewis
<p>I'm trying to get some info from entry like entry ID that the Guest plugin sent it via Ajax. <a href="https://github.com/pixelandtonic/GuestEntries#submitting-via-ajax" rel="nofollow noreferrer">There are the keys</a> that the plugin responds back with. How can I work out to those keys respectively call them? <code>(response.id)</code> for example?</p>

CC BY-SA 3.0
2017-04-15T18:36:00.320Z
Are you asking how to retrieve the data returned from the AJAX call?
Stephen Lewis
CC BY-SA 3.0
2017-04-15T18:41:41.203Z
Yes @StephenLewis
Dominik Krulak
<guest-entries>
How do you get entry's data from Ajax form submission with Guest plugin?
# How do you get entry's data from Ajax form submission with Guest plugin?

(Asked by: username_0 on 2017-04-15)

I'm trying to get some info from entry like entry ID that the Guest plugin sent it via Ajax. [There are the keys](https://github.com/pixelandtonic/GuestEntries#submitting-via-ajax) that the plugin responds back with. How can I work out to those keys respectively call them? `(response.id)` for example?

**Tags:** guest-entries
> **Comments:**
> **username_1**: Are you asking how to retrieve the data returned from the AJAX call?  
> **username_0**: Yes @StephenLewis  

---

## 1 answers

### Answer by username_1 on 2017-04-15. Score: 2 | Accepted answer

According to the README, the Guest Entries plugin accepts an AJAX request, and returns an object containing the entry ID, title, and so forth.
As such, if you're using jQuery, you should be able to do something like this (not tested):
$.ajax({
    data: $('#theform').serialize(),
    method: 'POST',
    done: function (data) {
        // The entry title.
        console.log(data.title);
    }
});

I'm not sure how Guest Entries handles errors, so you'll probably want to check the data.success property, before proceeding.

> **Comments:**
> **username_0**: I've ended up calling for entry's data with jQuery `response` function and so on as you've indicated for checking errors. That worked well!  

---

