Page 1 of 1

Cancel button not working

Posted: Tue Apr 29, 2014 5:46 pm
by Gjjansen
Hello,

I started developing a simple module, everythings goes well, but now i stuck with the 'cancel' button in the admin part..

I create the cancel button this way:

Code: Select all

<?php
if  (!isset($gCms))  exit;
	
	if (isset($params['cancel']))
	{
		$this->Redirect($id, 'defaultadmin', $returnid);
	}

$smarty->assign('cancel', $this->CreateInputSubmit($id, 'cancel', lang('cancel')));
	$smarty->assign('submit', $this->CreateInputSubmit($id, 'submit', lang('submit')));
    $smarty->assign('startform', $this->CreateFormStart ($id, 'orderview', $returnid));
    $smarty->assign('enform',$this->CreateFormEnd());
	
	echo  $this->ProcessTemplate('vieworder.tpl');

?>
And in the template i call it this way:

Code: Select all

{$startform}
<div class="pageoverflow">
	<p class="pagetext">&nbsp;</p>
	<p class="pageinput">{$submit}{$cancel}</p>
</div>
{$endform}
When i now click the cancel or submit button, it returns to admin/moduleinterface.php

What do i do wrong...

Kind regards,
Gjjansen

Re: Cancel button not working

Posted: Tue Apr 29, 2014 7:27 pm
by Gjjansen
I already found my stupid mistake that made my hours of searching..

I had to change

Code: Select all

$smarty->assign('startform', $this->CreateFormStart ($id, 'orderview', $returnid));
to:

Code: Select all

$smarty->assign('startform', $this->CreateFormStart ($id, 'admin_view_order', $returnid));


Kind regards,
Gjjansen