[pmwiki-users] pmwiki-users Digest, Vol 37, Issue 28

John Rankin john.rankin at affinity.co.nz
Mon Jul 14 16:56:08 CDT 2008


>Date: Mon, 14 Jul 2008 13:07:41 +0100
>From: Hans <design5 at softflow.co.uk>
>Subject: Re: [pmwiki-users] can wikiforms use fox form validation?
>To: david roundell <davidoswaldtwistle at hotmail.com>
>Cc: pmwiki-users at pmichaud.com
>Message-ID: <252004651.20080714130741 at softflow.co.uk>
>Content-Type: text/plain; charset=iso-8859-15
>
>Sunday, July 13, 2008, 11:46:43 PM, david roundell wrote:
>
>> i would prefer to display form submissions via wikiforms as i want submissions
>> to be edited if necessary. using fox doesn't give me an editable table of
>> submissions - just plain text under headings. however i would like to use the
>> form validation used by fox, in the style of: ......
>
>I think it would be rather difficult or impossible to use Fox's
>validation functions in the wikiforms script, but I don't
>really know.

I think you are probably right, which is a shame, because
adding validation would obviously be useful. At a minimum, it
would be really useful if an administrator could designate a
wikiforms field as "required" and have the recipe re-display
the form, with an error message, if the field is empty.

Hans, is there an online example where I can see what this
functionality looks like in foxforms? And what does it do if
there are 2 required fields and they are both empty?

Up to now, I have had this feature in the "too hard" basket.
>
>I just want to comment briefly on your statement:
>
>>  using fox doesn't give me an editable table of submissions -
>just plain text under headings.
>
>Fox plus Input markup allows creation of all kinds of edit forms.
>...
>But no doubt Wikiforms is much more specialised and clever in
>handling data tables. Fox is more of an all-purpose processor.

Yes, the 2 recipes' design goals are complementary (I might 
say "simple-minded" rather than specialised). I just needed a 
simple way to create and edit PITS-like pages, then leveraged
the functionality to create a forms-based front-end for passing 
page layout options to our typesetting system.

To solve David's problem, we need a way to:
- identify a field as "required" in the field definition markup
-- easy, once we can choose a suitable markup

- display (for example) a red asterisk against such fields on
  the form, with an explanatory note at the bottom
-- easy and should be do-able with suitable css classes

- re-present the form with any such empty fields highlighted
-- I need to think about this part; at the moment, the recipe
   doesn't have a way to reject a submitted form

However, I do have a suggestion, which may offer a temporary 
solution. Define the FormTemplate like this example:

!!Directory data form

!!!The following field is required

:Server name:servername title of server ("required"=50) +

!!!The following fields are optional

:Description:description (text=5*60)

:And so on: ...

The headings will form part of the form and tell the user
which fields are required, but *without* any validation.
It will also put "required" as the default text. You can
then create a (:wikilist servername='required':) to see who
has ignored the instruction. Whether this approach will 
be suitable rather depends on the good faith of the people
filling in the form.

Meanwhile, I'll have a look at the wikiforms code again,
peruse a foxforms example (if available) and think about
whether this enhancement is "reasonably do-able".

PS David, in your example, why use 1*50 rather than just a
simple 50 character text box?

JR
-- 
John Rankin
Affinity Limited
T 64 4 495 3737
F 64 4 473 7991
021 RANKIN
john.rankin at affinity.co.nz
www.affinity.co.nz





More information about the pmwiki-users mailing list