Multiple Forms

I am building a module that has forms within forms, for some reason the second form is not saving any data? Is it perhaps that BB doesn’t support multiple forms, or perhaps I have something wrong?

This is the code to my two forms which are being called correctly, just the second form is not saving entries


FLBuilder::register_settings_form('content_slider_form', array(
	'title' => __('Slider Form', 'fl-builder'),
	'tabs'  => array(
		'general'        => array( // Tab
			'title'         => __('Slide', 'fl-builder'), // Tab title
			'sections'      => array( // Tab Sections
				'general'       => array(
					'title'     => '',
					'fields'    => array(
                        
						'label'         => array(
							'type'          => 'text',
							'label'         => __('Slide Label', 'fl-builder'),
							'help'          => __('A label to identify this panel on the Custom Panel tab.', 'fl-builder')
						),  
                        
                        'slideBackground'         => array(
							'type'          => 'photo',
							'label'         => __('Add Background Image', 'fl-builder'),                             
						),
                        
                        'slideLink'         => array(
							'type'          => 'text',
							'label'         => __('Slide Link URL', 'fl-builder'),                             
						),
                        
                        'linkName'         => array(
							'type'          => 'text',
							'label'         => __('Slide Link Name', 'fl-builder'),                             
						),
                        
                        'slideContent'         => array(
							'type'          => 'form',
							'label'         => __('Add Layer', 'fl-builder'),
                            'form'        => 'slider_layer_form',
							'multiple'       => true,
                            'preview_text'  => 'label',                              
						),
					)
				),
			)
		),
		

	)
));  

FLBuilder::register_settings_form('slider_layer_form', array(
	'title' => __('Layer Form', 'fl-builder'),
	'tabs'  => array(
		'general'        => array( // Tab
			'title'         => __('Layer', 'fl-builder'), // Tab title
			'sections'      => array( // Tab Sections
				'general'       => array(
					'title'     => '',
					'fields'    => array(
                            
                        'label'         => array(
							'type'          => 'text',
							'label'         => __('Layer Label', 'fl-builder'),
							'help'          => __('A label to identify this panel on the Custom Panel tab.', 'fl-builder')
						),
                        
						  'slideLayer'         => array(
                                'type'          => 'select',
                                'label'         => __('Layer Type', 'fl-builder'),
                                  'preview_text'  => 'newlabel', 
                                'options'       => array(
                                    'text'  => 'Text',
                                    'image' => 'Image',
                                    'video' => 'Video',
                                    ),
                              'toggle'  => array(
                                  
                                    'text'  => array(
                                        'fields' => array( 'layerText' ),  
                                    ),
                                  
                                    'image'  => array(
                                        'fields' => array( 'layerImage' ),  
                                    ),
                                  
                                  
                                    'video'  => array(
                                        'fields' => array( 'layerVideo' ),  
                                    ),
                                  
                                  ),
                            ),
                        
                            'layerText' => array(
                                'type'  => 'editor',
                                'label'         => __('Add Content', 'fl-builder'),
                                'media_buttons' => true,
                                'rows'  => 16,
                            ),
                        
                        
                            'layerImage' => array(
                                'type'  => 'photo',
                                'label'         => __('Add Image', 'fl-builder'),
                            ),
                        
                        
                            'layerVideo' => array(
                                'type'  => 'text',
                                'label'         => __('Video URL', 'fl-builder'),
                            ),
                        
						)
					)
				),
			)
		),

));

Hey Jon,

Beaver Builder only supports two levels of forms, the first level module form and an additional nested form. Is there any way you can make it work with just two levels of forms? The code for nested forms is a bit tricky, so we’re not planning on adding support for additional levels at the moment.

Justin

Guess this is when to switch over to a CPT, thanks Justin