-
☆ A M B ☆
- 711 Posts
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
Thanks all.
-
☆ A M B ☆
- 711 Posts
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