# var fieldId = 'undefined' === typeof param.param_name ? param.id : param.param_name, defaultParam = 'undefined' === typeof param.default ? '' : param.default, option_value = _.isEmpty( option_value ) ? defaultParam : option_value, choices = 'undefined' === typeof param.choices ? [] : param.choices, options = option_value ? JSON.parse( FusionPageBuilderApp.base64Decode( option_value ) ) : [], placeholder = 'undefined' === typeof param.placeholder ? [] : param.placeholder, comparisons = 'undefined' === typeof param.comparisons ? [] : param.comparisons; if ( ! choices.length ) { // Filter map to only get form elements. formElements = _.filter( FusionPageBuilderApp.collection.models, function( element ) { var params = element.get( 'params' ); if ( 'object' !== typeof params ) { return false; } return element.get( 'element_type' ).includes( 'fusion_form' ) && 'fusion_form_submit' !== element.get( 'element_type' ) && 'fusion_form_image_select_input' !== element.get( 'element_type' ) && 'string' === typeof params.label && 'string' === typeof params.name; } ); _.each( formElements, function( formElement ) { var params = formElement.get( 'params' ), inputLabel = 'string' === typeof params.label && '' !== params.label ? params.label : params.name, elementType = formElement.get( 'element_type' ), arrayType = 'fusion_form_checkbox' === elementType || 'fusion_form_image_select' === elementType ? '[]' : '', options = {}; if ( ( 'undefined' !== typeof atts && atts.cid !== formElement.get( 'cid' ) ) && ( '' !== params.name || '' !== inputLabel ) ) { options = { 'id' : params.name + arrayType, 'title' : inputLabel, 'type' : 'text', 'comparisons' : comparisons }; choices.push( options ); } } ); } choices.unshift( placeholder ); #>