On Mon, Feb 9, 2009 at 11:00 AM, Hans <[email protected]> wrote:
> Monday, February 9, 2009, 3:48:44 PM, The wrote:
>
>>> [form]
>>> [text pw "{:password}"]
>>> [hidden password <(crypt pw)>]
>>> [submit 'Change Password']
>>> [session savedata password]
>>> [form]
>
>> Doesn't this require you to submit the form twice? Actually, are you
>> sure this works? Doesn't seem like it would. Didn't on my quick test.
>> You need to encrypt the password after the form is submitted. See my
>> other email... I definitely see you'll get the hang of this very
>> fast...
>
> No. just once. To be truthful: I tested this not on the password field,
> but a test data field I had created, 'abc':
>
> show value:
> abc data = {:abc}
>
> [form]
> [text abc1 "{:abc}"]
> [hidden abc <(crypt abc1)>]
> [submit 'Change abcPassword']
> [session savedata abc]
> [form]
I copied this to my wiki, and no matter what the value I enter, the
encrypted data field abc remains unchanged. Which is what it should
do.
First, to pass a value from one form field to another in BoltWire you
need to use the field replacement syntax:
[hidden abc <(crypt {=abc})>]
But second, the function <( )> is evaluated at page load time, not
form submission. There is no mechanism for that in BoltWire
currently, though we could possible consider doing something.
Generally a separate command is created for each function. See the
crypt.php plugin again. There's also a system function called
BOLTcomm2func which makes it very easy for a command to tap into a
function.
> Is it surprising that <(crypt ...)> evaluated when the form submits,
> and not before, in this case? I know only that for my PmWiki Fox forms
> I need to specify that a markup expression will be evaluated only
> after submit. I thought your <( ...)> syntax achieves this?
Yes exactly. The markup <( )> is processed after conditionals in the
markup table, so you can do things like:
[if whatever]<(forward some.other.page)>[if]
But it is still processed at page build time. Not form submission
time... The thought never occurred to me of having a way to evaluate
markup in form fields at time of form submission. Never had that in
zap either. We could escape it easily enough, but then would need some
syntax to indicate: "evaluate the markup on this form value". It is a
very intriguing idea. I'm open to suggestions for syntax.
Cheers
Dan
P.S. You'll notice ideas get implemented pretty rapidly around here.
Makes it hard to keep the docs and plugins current, but it does mean
BoltWire is moving along...
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"BoltWire" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/boltwire?hl=en
-~----------~----~----~----~------~----~------~--~---