[pmwiki-users] using arrays in input markup

Hans Bracker design at softflow.co.uk
Thu May 14 07:19:24 CDT 2015

> (Note the "color[]" as the name of the field - I'm not sure if
> that's technically an "array" in HTML, but that's what I'm referring to.)

Fox can handle such input arrays. for instance with the following Fox form
Fox will post a line each for each colour box ticked, by using the
replacement variable {$$color[]} in the template, i.e. the template
gets used repeatedly for each array value submitted.

Output example:
Colour is red
Colour is blue
Colour is green

(:fox testform target={$FullName}:)
(:input default request=1:)
Colors: (:input checkbox color[] value="red":) Red (:input checkbox color[] value="blue":) Blue (:input checkbox color[] value="green":) Green
(:foxtemplate "Colour is {$$color[]}":)
(:input submit post:)
(:foxend testform:)

And if one would use instead the replacement variable {$$color} in the
template, Fox would post a single line with the ticked values as a
comma separated list.

Output example:
Colour is red,blue,green

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

More information about the pmwiki-users mailing list