[pmwiki-users] ZAP getdata syntax

The Editor editor at fast.st
Wed Oct 11 17:22:29 CDT 2006


On 10/11/06, Christophe David <pmwiki at christophedavid.org> wrote:
> Could someone please give an example how "pre-fill" the fields of a form
> using the stored values with ZAP ?
>
> Example : a form where a user stores his personal data (name, address,
> etc.).  When the user comes back to his page, he should find the fields
> "pre-filled" with the stored values.
>
> I guess it must be done using "getdata", but I cannot figure out the right
> syntax.
>
> Thank you in anticipation.
>
> Christophe


Hi Christophe,

Try the code snippet at
http://www.fast.st/zap/pmwiki.php?n=Snippets.UpdateForms to see how it
looks and works.  (Or go to www.zapsite.org and click code snippets,
update forms).

Normally you use GetData to retrieve info into a hidden field that you
do not want someone seeing by looking at the html source code, such as
a password or email address.  You use the ZAPdata directive to
retrieve all the data values as page variables, and then use those
page variables to prepopulate the form fields.

When Pm redoes the Forms script (scheduled I believe for this beta
run) it should allow you to more easily update things like radio
buttons, select menus, and checkboxes. Right now those are rather
difficult to work with.

Cheers,
Caveman

PS.  ZAP is still a bit buggy, but it would be better to use it than
try FAST Data as the markup will all be changed with ZAP. With ZAP it
should stay stable for a good little why now. Let me know if you
notice problems anywhere.




More information about the pmwiki-users mailing list