[pmwiki-users] Cancel option with PmForm?

Petko Yotov 5ko at 5ko.fr
Fri May 15 03:15:45 CDT 2009


On Friday 15 May 2009 08:40:24 Oliver Betz wrote:
> Petko Yotov wrote:
> >> is there a simple way to get a working "Cancel" button with PmForm?
> >
> >A cancel button like in the regular edit form, no. But a simple link could
> > do the job :
> >   [[{*$FullName} | Cancel ]]
>
> I did so (to the "success page" instead of {*$FullName}), but the
> appearance is inconsistent and unintuitive.

How about something like this in config.php, before including pmform.php :

  if(@$_REQUEST['action']=='pmform' && @$_REQUEST['cancel']>''
     && @$_REQUEST['successpage']>'')
  {
    Redirect(MakePageName($pagename, $_REQUEST['successpage']));
    exit;
  }

Then, in the template, you set (:input submit name=cancel value="Cancel!":)

Alternatively, you may add in the template:
 (:input hidden cancelpage Group.Page:)

and in the above snippet, use $_REQUEST['cancelpage'] instead of 
$_REQUEST['successpage'].


> BTW: Will PmForm be maintained in the future, or will development stop
> since there are other form processors?

AFAIK PmForm was created *because* there were other form processors (ZAP, 
Fox). There are no plans to kill PmForms at this time.

Thanks,
Petko



More information about the pmwiki-users mailing list