[pmwiki-users] Enforce Data Entry on Zap Forms -- Modal Dialogs in PMwiki?

The Editor editor at fast.st
Mon Jan 29 19:33:07 CST 2007


On 1/12/07, Sivakatirswami <katir at hindu.org> wrote:
> Posting again in hopes of some light:
> ---------
>
>  I'm having  a little problem with ZAP forms
>  -- not  specific to ZAP as such any form could have the same issue
>
>  where we need to enforce data entry of all fields and option selections.

(snip)

>  Does  PhP have modal dialogs for PMWiki with an "OK" button to dismiss
>  and drop the user back to the page as it was? That would be ideal.


If you put a line like this in your form, it will require the field to
be filled in (but not anything else):

(:messages:)
(:zapform:)
(:input text Test:)
(:zap if="equal {Test} ''||warn|Input required for field Test":)
(:zap warn="":)
(:input submit:)
(:zapend:)

Normally you would want to add whatever other lines you want *after* warn.

Also, this probably won't preserve the info they enter unless you save
it to the page, or pass it back to the page or something along those
lines...

Cheers,
Dan

PS.  Crisses once asked how to only submit a form when a honeypot kind
of field was left blank (to stop spambots).  That could be done using
the same thing, simply changine the conditional to

(:zap if="! equal {HoneyPot} ''||warn|Don't Email This...":) or to flip it

(:zap if="equal {HoneyPot} ''||emailto|email at example.com":) and
otherwise emailto is blank... Choices, choices.



More information about the pmwiki-users mailing list