We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37550 ☆ A M B ☆
    • 711 Posts
    onesmarthost Reply #1, 19 years ago
    Hi all,

    I’m trying to make my form return to the original page which it was clicked on i.e. editor.html but when trying to use the &gotoid= it seems to not log the form details to the database.

    I’ve also tried adding a header redirect after the SQL update in my onbeforemailsent function.


    [[UpdateTemplate]]
    [[show_templates]]
    [[eForm? &formid=`guest_form` &tpl=`select_template` &noemail=`1` &eFormOnBeforeFormParse=`showTemplates` &eFormOnBeforeMailSent=`UpdateTemplate` &protectSubmit=`0` ]]

    UpdateTemplate Function:


    <?php
    function UpdateTemplate( &$fields )
    {
    global $modx, $table_prefix;
    $usernameid = $modx->getLoginUserID();

    // Init our array
    $dbTable = array();
    $dbTable[template_id] = implode(",", $fields[mytemplate]);
    $dbQuery = $modx->db->update($dbTable, $table_prefix . ’web_user_details’, ’webuser = "’ .$usernameid .’"’ );
    header(’Location: editor.html’);
    return true;
    }
    // Return empty string
    return ’’;
    ?>

    As usual any help would be much appreciated smiley

    Thanks all.
      http://www.onesmarthost.co.uk
      UK MODX Hosting with love.
      • 37550 ☆ A M B ☆
      • 711 Posts
      onesmarthost Reply #2, 19 years ago
      Ignore this thread.

      i should know better now than to post questions late at night, it turned out my page showing the template selection was set to cache in MODx manager.

      Doh!

      Thanks
        http://www.onesmarthost.co.uk
        UK MODX Hosting with love.