[pmwiki-users] PmWiki 2.2.79 released (PmForm target)

Hans Bracker design at softflow.co.uk
Fri Aug 28 03:30:41 CDT 2015

Thursday, August 27, 2015, 11:52:43 AM, Petko wrote:

> I'm not yet sure how to address this problem so for the moment I 
> reverted the change -- I suspect many more people need the "target" 
> PmForm attribute than the "target" HTML attribute.

> I tried changing PmForm to automatically handle the target setting 
> without the need for it to be written in a template, but I suspect some
> complex PmForms may require more than one forms with different target 
> settings so this would not work.

> One can argue that the PmForm "target" attribute was not well named at
> the beginning, but people are using it and we don't want to force them
> to rewrite all their local templates when they upgrade, unless if there
> is no way around.

Could the pmforms.php script not simply set the InputAttr array, so
'target' gets excluded from it, and the PmWiki forms.php script has it
set including 'target'? I.e. add to pmforms.php

SDV($InputAttrs, array('name', 'value', 'id', 'class', 'rows', 'cols',
  'size', 'maxlength', 'action', 'method', 'accesskey', 'tabindex', 'multiple',
  'checked', 'disabled', 'readonly', 'enctype', 'src', 'alt',
  'required', 'placeholder', 'autocomplete', 'min', 'max', 'step' ));

That would be a normal way a recipe needs to respond to a change in
the PmWiki core scripts, if an incompatibility issue arises. I had to do
it countless times, and could not call on PmWiki to accomodate the
needs of my cookbook scripts.

I did find the use of the term 'target' in PmForms a bit confusing,
and did choose a different meaning for it in the Fox form processor,
i.e. 'target' will point in general to the page the form should post
to. This still is a different meaning as the HTML 'target' attribute
though. But 'target' in a Fox form never gets set as an attribute in
an 'input' directive, but in a (:fox... :) directive which marks the
start of a fox form, and will always be rendered as a hidden input
field with name 'target'.

The HTML 'target' attribute may be useful in some cases, and I would
not wish it not to be available if need be. I appreciate that the
PmWiki core is accommodating new HTML developments.

Best regards,
mailto:design at softflow.co.uk

More information about the pmwiki-users mailing list