Jump to content

Recommended Posts

Posted

Hi Team
I am trying to fetch the label of form fields with this api function.

$form = $forms->get('shop-payment-stripe');
        $fieldDefinitions = $form->fields;

If I try to print $fieldDefinitions it shows empty.
Also, if I print $form variable it is surely returning ProcessWire\FormBuilderForm Object.
Any suggestions how to get the form field labels. (Field names are surely accessible from form)

Posted
1 hour ago, Mohit said:

Any suggestions how to get the form field labels.

$form->children should give you the (structured) fields. If you want the returned list flattened, you can call $form->getChildrenFlat().

Posted

Thanks Alot @BitPoet. It surely worked.
One more question I have all my form data in an array. I just want to submit my $form and let it do all its functionality that I have assigned in backend with just API.
I have saved its entries with 

$forms->saveEntry( $stripeBillDataArr,$form);

The entries saving part is surely working fine but the form is not sending mail as it was configured to send mail to admin from the backend panel.
I have tried many different functions as well but nothing is working for me.
Any suggestions?
 

 

Posted

Not sure if that's easily possible without duplicating a lot of functionality from FormBuilderProcessor. As far as I can see, most methods involved in sending the emails are protected. Maybe the question should be asked in the FormBuilder support forum.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...