We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 30765
    • 66 Posts
    Hi,

    I’m using Eform as the basis for a user management snippet -- login, change your account, retrieve your password, and so on. It works very well. However, I’ve hit a small snag; on the account management page, I’d like people to be able to submit a change, have the change saved, and then have the form re-presented with a success message. Eform usually returns a ’thankyou’ chunk when a form is successfully saved, rather than re-presenting the form. I’d like to display the ’thankyou’ chunk *and* the form.

    I saw this thread which seemed to do the trick, but because it creates a bogus error the form doesn’t actually get saved. Which obviously won’t work in my case.

    I’ve tried including the form chunk in the thankyou chunk, but it doesn’t get parsed by Eform. Any other ideas? My best two options at the minute seem to be to doing a JavaScript redirect in the thankyou chunk, which is kinda clunky but at least would work, or following the advice in the thread above and add my own code to save the form in an event handler, but I don’t really want to go there.

    Suggestions appreciated ;-).

    Thanks
    Matt

      • 29774
      • 386 Posts
      Don’t allow eform to complete. After you have saved the form data to the db using a function attached to the relevant eform event do a $modx->sendRediect() to the current page with ?updated=1 appended to the URL. Make sure you have a function attached to oneformbeforeformparse (?) event to repopulate the form from the db with your saved data, and to display an update message if $_GET[’updated’] ==1

      By the way, I think a lot of people would be very interested to see your user registration implementation using eform.
        Snippets: GoogleMap | FileDetails | Related Plugin: SSL