ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Retrieving edited field with Safecracker (using AJAX)

March 26, 2012 6:41am

Subscribe [1]
  • #1 / Mar 26, 2012 6:41am

    Jules van Schaijik

    210 posts

    I would like to be able to edit entries in the front end, in the same way as I can edit comments in the front end using the edit_comment_script tag.
    It seems as if Safecracker makes this possible. However, I can’t figure our how to access the changed fields (title, url_title, body_text, etc.) after they have been edited. Are they not returned in function(data) upon success?

  • #2 / Mar 27, 2012 2:44pm

    Dan Decker

    7338 posts

    Hi Jules van Schaijik,

    The AJAX driven entry form is supplied as an example of what’s possible. Have you tried stepping through the returned data to see what all it contains?

    You can also use the json= parameter to have your entry returned in JSON format rather than redirecting to a new page.

    Cheers,

  • #3 / Mar 27, 2012 5:49pm

    Jules van Schaijik

    210 posts

    I’ve looked at the AJAX driven entry form. That’s what gave rise to the question.  That form shows that data.entry_id is returned, but not any of the other fields connected with the entry, such as data.title or data.date.

  • #4 / Mar 30, 2012 5:36pm

    Dan Decker

    7338 posts

    Hi Jules,

    I just ran a test using the json parameter and it returns the url_title, but no other fields. You might need to employ a bit more JavaScript to capture any of the other fields that were changed.

    You can also submit a Feature Request to have more fields added to the return data.

    Cheers,

  • #5 / Mar 30, 2012 7:13pm

    Jules van Schaijik

    210 posts

    Thanks.  I’ll have to look into it when I have some more time.

  • #6 / Apr 04, 2012 4:19pm

    Dan Decker

    7338 posts

    Hey Jules,

    Fair enough!

    If you need anything else in the meantime, just let us know in a new thread.

    Cheers,

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases