[pmwiki-users] ZAPdata savedata question

The Editor editor at fast.st
Sun Nov 19 11:31:50 CST 2006


William,

I set it up on my machine and it worked like a charm with your exact
code.  The logic was slightly off from what I think you wanted so I
changed it so that when you click update it switches to the view
screen.  That was a trick.  I thought about adding in a hide button to
go back to the default but it got even more complicated quick.

Anyway, I tinkered with it some and put up the code on my server under
the Rolodex snippet.  You can check it out there if you want.

http://www.fast.st/zap/pmwiki.php?n=Snippets.Rolodex

As for why it's not working on your machine, I don't know.  You might
just see if ZAP is working at all with some very simple form.  Then
check to make sure you have the latest beta of PmWiki and ZAP.

Hope this helps...  The revised code below.

Cheers,
Caveman


_______________________

(:zapdata:)
(:zapget:)
(:zapform:)

(:if equal {$myaction} "View" :)
||border=0 cellspacing=0 width=200
||Name: ||{$Field1}
||Phone: ||{$Field2}
||Email: ||{$Field3}
\\
Address:\\
{$FieldTextArea}
(:ifend:)

(:if equal {$myaction} "Update" :)
||border=0 cellspacing=0 width=300
||Name: ||(:input text Field1 {$Field1} size=35:)
||Phone: ||(:input text Field2 {$Field2} size=35:)
||Email: ||(:input text Field3 {$Field3} size=35:)
\\
Address:\\
(:textarea name=FieldTextArea cols=28 rows=7:)(:keep
{$FieldTextArea}:)(:textareaend:)\\
(:input hidden savedata "Field1,Field2,Field3,FieldTextArea":)
(:input hidden myaction View:)
(:ifend:)

(:if ! equal {$myaction} "Update" :)
(:input hidden myaction {button}:)
(:ifend:)

(:input hidden passdata myaction:)
(:input submit button "View":)
(:input submit button "Update":)
(:zapend:)




More information about the pmwiki-users mailing list