<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px"><div><span></span></div><br> <blockquote id="yui_3_16_0_1_1443106957537_3838" style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; margin-top: 5px; padding-left: 5px;">  <div id="yui_3_16_0_1_1443106957537_3837" style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;"> <div id="yui_3_16_0_1_1443106957537_3836" style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;"> <div id="yui_3_16_0_1_1443106957537_3835" dir="ltr"> <hr size="1">  <font id="yui_3_16_0_1_1443106957537_3834" face="Arial" size="2"> <b><span style="font-weight:bold;">From:</span></b> "pmwiki-users-request@pmichaud.com" <pmwiki-users-request@pmichaud.com><br> <b><span style="font-weight: bold;">To:</span></b> pmwiki-users@pmichaud.com <br> <b><span style="font-weight: bold;">Sent:</span></b> Thursday, September 24, 2015 1:00 PM<br> <b><span style="font-weight: bold;">Subject:</span></b> pmwiki-users Digest, Vol 123, Issue 15<br> </font> </div> <div id="yui_3_16_0_1_1443106957537_3839" class="y_msg_container"><br>Send pmwiki-users mailing list submissions to<br>    <a ymailto="mailto:pmwiki-users@pmichaud.com" href="mailto:pmwiki-users@pmichaud.com">pmwiki-users@pmichaud.com</a><br><br>To subscribe or unsubscribe via the World Wide Web, visit<br>    <a href="http://www.pmichaud.com/mailman/listinfo/pmwiki-users" target="_blank">http://www.pmichaud.com/mailman/listinfo/pmwiki-users</a><br>or, via email, send a message with subject or body 'help' to<br>    <a ymailto="mailto:pmwiki-users-request@pmichaud.com" href="mailto:pmwiki-users-request@pmichaud.com">pmwiki-users-request@pmichaud.com</a><br><br>You can reach the person managing the list at<br>    <a ymailto="mailto:pmwiki-users-owner@pmichaud.com" href="mailto:pmwiki-users-owner@pmichaud.com">pmwiki-users-owner@pmichaud.com</a><br><br>When replying, please edit your Subject line so it is more specific<br>than "Re: Contents of pmwiki-users digest..."<br><br><br>Today's Topics:<br><br>   1. Re: Multiple checkboxes (Petko Yotov)<br>   2. Re: Multiple checkboxes (Hans Bracker)<br><br><br>----------------------------------------------------------------------<br><br>Message: 1<br>Date: Wed, 23 Sep 2015 20:35:23 +0200<br>From: Petko Yotov <<a ymailto="mailto:5ko@5ko.fr" href="mailto:5ko@5ko.fr">5ko@5ko.fr</a>><br>To: PmWiki Users <<a ymailto="mailto:pmwiki-users@pmichaud.com" href="mailto:pmwiki-users@pmichaud.com">pmwiki-users@pmichaud.com</a>><br>Subject: Re: [pmwiki-users] Multiple checkboxes<br>Message-ID: <<a ymailto="mailto:314a1281008a73de930f81f7b4710f4b@5ko.fr" href="mailto:314a1281008a73de930f81f7b4710f4b@5ko.fr">314a1281008a73de930f81f7b4710f4b@5ko.fr</a>><br>Content-Type: text/plain; charset=US-ASCII; format=flowed<br><br>On 2015-09-22 18:51, Hans Bracker wrote:<br>> multiple input box ticking results in a PTV looking something like <br>> this:<br>> <br>> Hobby: Travels,Photography,Music<br>> <br>> which then would not populate input defaults correctly, ie. it needs<br>> spaces between values not commas!<br>> <br>> How can we resolve this? I could add a Fox config variable<br>> "$FoxPTVArraySeparator", which could be set to a comma or a space or<br>> even a comma and a space or what ever. I am not sure what a change in<br>> the default from comma to space would break for sites updating<br>> fox.php.<br>> Could PmWiki have a similar configuration variable, so instead of a  <br>> space<br>> a comma could be used in a PTV holding array elements?<br><br>Yes, it could. The new feature was added recently and is not yet in the <br>core documentation so we can change it.<br><br>Currently "space" is a separator but not so simple: one can quote <br>strings containing spaces; this comes very handy from ParseArgs().<br><br>   (:input default name[] val1 "val 2" val3 val4:)<br>   -> note, may change!<br><br>Using a simple explode() with a separator is very easy but what happens <br>if one of the values contains the separator?<br><br>Also, the current markup for all input elements:<br><br>   (:input ELEMENT name 1,2,3,4,somevalue:)<br><br>means that the "value" argument in the HTML input tag is <br>"1,2,3,4,somevalue". It is not very consistent to have ONE way to define <br>a value in (:input text name value:), (:input checkbox name value:) or <br>any other element, and ANOTHER in (:input default name value:).<br><br>I also also think that an existing PTV in the page should be able to <br>check/uncheck the checkboxes, by simply setting (:input default <br>source=1:).<br><br>Let me think about it.<br><br>Petko<br><br>-- <br>Change log     :  <a href="http://www.pmwiki.org/wiki/PmWiki/ChangeLog" target="_blank">http://www.pmwiki.org/wiki/PmWiki/ChangeLog</a><br>Release notes  :  <a href="http://www.pmwiki.org/wiki/PmWiki/ReleaseNotes" target="_blank">http://www.pmwiki.org/wiki/PmWiki/ReleaseNotes</a><br>If you upgrade :  <a href="http://www.pmwiki.org/wiki/PmWiki/Upgrades" target="_blank">http://www.pmwiki.org/wiki/PmWiki/Upgrades</a><br><br><br><br><br>------------------------------<br><br>Message: 2<br>Date: Thu, 24 Sep 2015 11:42:51 +0100<br>From: Hans Bracker <<a ymailto="mailto:design@softflow.co.uk" href="mailto:design@softflow.co.uk">design@softflow.co.uk</a>><br>To: Petko Yotov <<a ymailto="mailto:5ko@5ko.fr" href="mailto:5ko@5ko.fr">5ko@5ko.fr</a>><br>Cc: PmWiki Users <<a ymailto="mailto:pmwiki-users@pmichaud.com" href="mailto:pmwiki-users@pmichaud.com">pmwiki-users@pmichaud.com</a>><br>Subject: Re: [pmwiki-users] Multiple checkboxes<br>Message-ID: <<a ymailto="mailto:100685613.20150924114251@softflow.co.uk" href="mailto:100685613.20150924114251@softflow.co.uk">100685613.20150924114251@softflow.co.uk</a>><br>Content-Type: text/plain; charset=us-ascii<br><br><br>> Using a simple explode() with a separator is very easy but what happens<br>> if one of the values contains the separator?<br><br>> Also, the current markup for all input elements:<br><br>>    (:input ELEMENT name 1,2,3,4,somevalue:)<br><br>> means that the "value" argument in the HTML input tag is <br>> "1,2,3,4,somevalue". It is not very consistent to have ONE way to define<br>> a value in (:input text name value:), (:input checkbox name value:) or<br>> any other element, and ANOTHER in (:input default name value:).<br><br>I agree. I also think it may be too much to push the array concept<br>too far when we want to save arrays in simple PTVs.<br>Since the space separator works well enough with (:input default:),<br>as illustrated with your example, it may be best to leave it at that.<br><br>I will publish a fox.php version, which will use space as separatot<br>when saving array values in a PTV, by default. And have an optional<br>$FoxPTVArraySeparator variable, which can be set to "," or other<br>separator character strings.<br><br>I also found a way to have checkboxes reflect the values in such a<br>PTV, by using a simple markup expression to clean up the PTV for use<br>with spaces in (:input default .. :), like in this form example:<br><br>(:foxmessages:)<br>(:fox frm ptvtarget=Main.WikiSandbox ptvfmt=text :)<br>(:input default $:Hobby[] {(foxcleanptv "{$:Hobby}")} :)<br>(:input hidden $:Hobby " ":)<br>(:input checkbox $:Hobby[] Travels:) Travels<br>(:input checkbox $:Hobby[] Photo:) Photography<br>(:input checkbox $:Hobby[] Music:) Music<br>(:input submit post:)<br>(:foxend frm:)<br><br>The markup expression defined in config.php:<br><br>$MarkupExpr['foxcleanptv'] = 'FoxCleanPTV($args[0])';<br>function FoxCleanPTV($arg) {<br>        global $FoxPTVArraySeparator;<br>        $pat = '/'.$FoxPTVArraySeparator.'/';<br>        return preg_replace($pat," ",$arg);<br>}<br><br>This seems to work well with various separators, and the PTV can look<br>for instance like these, in simple text PTVs:<br><br>Hobby: Travels,Photo,Music<br>Hobby: Travels, Photo, Music<br>Hobby: Travels + Photo + Music<br><br><br>Best regards,<br> Hans                         <br>mailto:<a ymailto="mailto:design@softflow.co.uk" href="mailto:design@softflow.co.uk">design@softflow.co.uk</a><br>www.softflow.co.uk<br><br><br><br><br>------------------------------<br><br>Subject: Digest Footer<br><br>_______________________________________________<br>pmwiki-users mailing list<br><a ymailto="mailto:pmwiki-users@pmichaud.com" href="mailto:pmwiki-users@pmichaud.com">pmwiki-users@pmichaud.com</a><br><a href="http://www.pmichaud.com/mailman/listinfo/pmwiki-users" target="_blank">http://www.pmichaud.com/mailman/listinfo/pmwiki-users</a><br><br><br>------------------------------<br><br>End of pmwiki-users Digest, Vol 123, Issue 15<br>*********************************************<br><br><br></div> </div> </div> </blockquote>  </div></body></html>