New fills versus edits

(Note: “prefill” is an option that will appear in the (1.2.0) release of PZPlusForms.)

Probably the first thing to say is that, since the “prefill” box is checked by default, the forms you use in PeakZebra will generally prefill (or not) as you’d generally expect them to, without your needing to do anything special.

But there may be the occasional situation where you’ll need a better understanding of the options…

Some forms are really only meant to be filled out once per user.

For example, when you offer a newsletter signup, you don’t really need the user to fill out the form a second or third time. By the same token, if a user chooses to revisit that signup form, they won’t particularly expect that info they provided in the past will be prefilled there.

In this “new fill” scenario, PeakZebra can simply pre-render the form in the page, where it can be delivered to a browser client without any processing at delivery time.

In other situations, of course, you’ll want the current user’s information, to the extent that you have it, to be prefilled in the form when it’s presented. If the user has already shared their name, for instance, you’ll want to prefill that field.

In this “edit” scenario, PeakZebra needs to retrieve the data from the database before the form is presented to the user.

To cause a prefill, click the “prefill” checkbox in the block inspector panel (in the block editor, usually to the right side of the window). If you do so, the form will first consult the URL that was requested to see if a “selected” parameter has been set (this is what will happen if the user has selected an option from the select dropdown provided by pzselect). Additionally, you’ll need to select a table and a field, just as you would do when configuring a field within a form.

The table and field you select will be matched with the “selected” parameter value. If there’s more than one matching record in the database, the first record returned will be used.

If there’s no “selected” parameter set in the URL, then the current person will be used, if one has been set.

If there’s no “selected” parameter set and a current person has not been set, then the form will not be prefilled, even if the prefill box is checked.

How'd we do?
Updated on March 15, 2025