[pmwiki-users] PmForm: MailForm - "clicky things"

Steve Glover steve at fell-services.net
Thu Jan 10 03:29:15 CST 2008


On Tue, 2008-01-08 at 18:48 +0000, Steve Glover wrote:

> Has anyone used PmForm's MailForm with either checkboxes or radio
> buttons, please?

Answering my own question - it's 'orribly kludgy, but this seems to
work:

!! #mailform2

This form is displayed when [@form=#mailform2@] is displayed by a pmform
target.

[@
[[#mailform2]]
(:template default successpage='' :)
(:input pmform target={$$target} successpage="{$$successpage}" :)
(:input default request=1:)
(:messages:)
(:input hidden choice1 value='No' :)
(:input hidden choice2 value='No' :)
(:input hidden choice3 value='No' :)
(:input hidden subject value='Event Choice' :)
||width='' 
||$[Your name]: ||(:input text name size=30:) ||
||$[Your email address]: ||(:input text from size=30:) ||
||$[Attending camp one]: ||(:input checkbox choice1 value='Yes' :) ||
||$[Attending camp two]: ||(:input checkbox choice2 value='Yes' :) ||
||$[Attending camp three]: ||(:input checkbox choice3 value='Yes' :) ||
{$Captcha} (:input captcha:) \\
(:input submit name=post value='$[Send]':)
(:input end:)
[[#mailform2end]]
@]

!! #mailpost2

This specifies the message to be sent when [@fmt=#mailpost2@] is given
by a pmform target.  It verifies the existence of a name, email address
and captcha.

[@
[[#mailpost2]]
(:template require from errmsg="$[Missing email address]" :)
(:template require name errmsg="$[Missing name]" :)
(:template require if="captcha" errmsg="$[Captcha required]" :)

Attending event one: {$$choice1} 
Attending event two: {$$choice2}
Attending event three: {$$choice3}

==========
Sent via PmForm at {$$PageUrl}
[[#mailpostend2]] 
@]

Hoping this may be helpful to some....

Steve

-- 
Steve Glover at                          email: steve at fell-services.net
SDSS, EDINA, University of Edinburgh,          tel: +44 (0)131-650 2908
Causewayside House, 160 Causewayside,          fax: +44 (0)131-650 3308
Edinburgh EH9 1PR                          mobile: +44 (0) 7961 446 902




More information about the pmwiki-users mailing list