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.

Multiple Safecracker Forms on same page/template

September 19, 2011 10:34am

Subscribe [3]
  • #1 / Sep 19, 2011 10:34am

    crossfade

    31 posts

    Hi,

    I’m hoping that somebody can help me here.  I’ve been struggling with this issue for a couple of hours now and it’s getting the better of me.

    I have a page with multiple safecracker forms, and it seems that only the first form outputted on the page will work.

    I found this blog post:

    http://blog.mcnicholl.com/2011/06/22/multiple-safecracker-instances-in-one-expression-engine-template/

    But it seems that the structure of the directories and the safecracker file itself has changed since this was written (This is a new install on 2.2.2)

    By the way, I have set all the forms with their own id and tried all the other things possible with regards to normal issues that occur with multiple forms on the same page, but nothing seems to work.

    Anyone able to help?

    Thanks!

  • #2 / Sep 19, 2011 7:44pm

    Dan Decker

    7338 posts

    crossfade,

    I’m afraid this falls in unsupported territory. There are numerous bits of javascript that SafeCracker injects as part of what it does. Due to the likelihood of collisions, we can only support 1 SafeCracker instance per page. Is there anything else we can assist you with?

    Cheers,

  • #3 / Sep 19, 2011 8:11pm

    crossfade

    31 posts

    Hey, thanks for the reply 😊

    Just a question.  Does “unsupported” mean that it’s impossible, or just that there’s no official word on how to do it?

    Or is it actually purposely limited in this way?

    I’m trying to allow updating of only a couple of fields from a list of channel entries.  Is there a way of doing this without the user having to click on a link to open a new window?  It looked like it was working great, until I found it was only working for the first entry.

  • #4 / Sep 20, 2011 1:49pm

    Mark Bowen

    12637 posts

    Hi crossfade,

    As Dan has mentioned above it’s not really something we could comment on as we can only support 1 instance per page at this moment in time. Whether that will ever change I really don’t know and so can’t say on that one.

    When you say click on a link to open a new window I’m not too sure how you have everything set up but you don’t have to open a new window in order to use Safecracker. You could for instance have a page that lists the entries that need updating and have a link which takes the user to the Safecracker form to edit that entry and then take them back to that list again where they can update the next one and so on and so forth.

    Does that help?

    Thanks,

    Mark

  • #5 / Sep 22, 2011 10:05pm

    crossfade

    31 posts

    Hi Mark,

    Thanks for the reply. I actually worked out a way of doing what I wanted to do without using safecracker.

    Basically the scenario you describe is what used to be the case.  The user would click on the entry, be taken to a form to complete and then be taken back to the updated list.

    What I was trying to do, however, was reduce the need for any clicks/mouse use.

    I have achieved this with the solution that I have worked out, so it’s all good.

    Thanks again for the reply.

  • #6 / Sep 22, 2011 10:46pm

    Dan Decker

    7338 posts

    crossfade,

    Glad to see you found a solution that works for you! Please feel free to start a new thread if you ever need assistance in the future.

    Cheers!

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

ExpressionEngine News!

#eecms, #events, #releases