#1 September 4, 2019 5:39pm

Scarfex
Member
Registered: January 4, 2019
Posts: 14

Custom Form Builder

Hey there,

I'm trying to use the form builder to display a form within a callout so its in a small area on my webpage.

I've edited the template files and gotten as far as to call the callout and draw the form fields on the page.
However, what has me stuck is the the processing of the form.

The process.php file uses global $form variable and others but I declared my $form variable from the callout.

Is there a way to edit the global $form variable?
Or declare my variable as a global one?
Where is the default $form even stored anyway?

Offline

#2 September 7, 2019 7:12am

timbuckingham
Administrator
From: Baltimore, MD
Registered: April 2, 2012
Posts: 974

Re: Custom Form Builder

I responded via email to this already but I figured I'd post here in case anyone else had the same question!

$form (the array) is generated in the Form Builder template's _header.php file.

The way we usually do this is by making the callout target a page which actually hosts the regular form builder template with the desired form selected. Then we have the callout pull the page’s data, find what form it’s using, and then draw that form’s fields. We then have that callout’s action attribute target the /process/ route on the page and let the regular template handle processing, thank you, and error validation. It could be done via AJAX with a lot of effort and kept all inside the callout space but it’s a lot of effort for not much pay-off.

Offline

Board footer

Powered by FluxBB

The Discussion Forum is not available on displays of this size.