0 users online. Create an account or sign in to join them.Users

Search

I'm trying to make a multi-page form that updates a single section. So I want to take the entry-id of the first form submisson on to the other pages.

I thought the way to do this would be to submit the first bunch of inputs with an event so that the entry-id is created but then fire a second event where I could redirect to a 2nd page of the form and pass the entry-id as a page parameter so I'd know which entry the next page form was updating.

I think the old way was something like:

    public function load(){
    $this->post = $_POST;
    if(isset($_POST['action'][$this->ROOTELEMENT])) return $this->__trigger();
}

protected function __trigger(){
    unset($_POST['fields']);
    $_POST['fields'] = $this->post[$this->ROOTELEMENT]['fields'];
    $_POST['id'] = $this->post[$this->ROOTELEMENT]['id'];

    include(TOOLKIT . '/events/event.section.php');
    return $result;
}

but this isn't the way anymore and I can't seem to find any up-to-date examples of how it's changed.

I just want to submit a page of form fields, grab the entry-id of what I just submitted then send that off to a second page, "remembering" the entry-id that was just created.

Can someone give me a quick example to get me going?

OK the newer way is execute() which I copied out of the core into my event. I was then able to grab the entry id just before the redirect fires.

The __doit function actually creates the entry but passes back an xmlelement $result that contains the data of the newly created entry.

I appended the entry id to the end of the redirect url so I can grab the correct entry to append in the next page of my form.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details