PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / trunk
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More vtrunk
6.35 6.34 6.33.1 6.33 6.32.1 6.32 6.31 6.25 6.25.1 6.26 6.26.1 6.27 6.28 6.29 6.3 6.3.1 6.3.2 6.30 6.4 6.4.1 6.4.2 6.5 6.5.1 6.5.2 6.5.3 All 141 releases
formidable / classes / views / combo-fields / input.php

input.php in Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More trunk, at classes/views/combo-fields/input.php

76 lines 2.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if ( ! defined( 'ABSPATH' ) ) {
3 die( 'You are not allowed to call this page directly.' );
4 }
5 ?>
6 <fieldset aria-labelledby="<?php echo esc_attr( $html_id ); ?>_label">
7 <legend class="frm_screen_reader frm_hidden">
8 <?php echo esc_html( $field['name'] ); ?>
9 </legend>
10 <div class="frm_combo_inputs_container">
11 <?php foreach ( $sub_fields as $key => $sub_field ) { ?>
12 <div id="frm_field_<?php echo esc_attr( $field['id'] . '-' . $key ); ?>_container" class="frm_form_field form-field <?php
13 echo esc_attr( $sub_field['classes'] );
14
15 if ( isset( $errors ) ) {
16 FrmComboFieldsController::maybe_add_error_class( compact( 'field', 'key', 'errors', 'atts' ) );
17 }
18 ?>">
19 <label for="<?php echo esc_attr( $html_id . '_' . $key ); ?>" class="frm_screen_reader frm_hidden">
20 <?php echo esc_html( ! empty( $field[ $key . '_desc' ] ) ? $field[ $key . '_desc' ] : $field['name'] ); ?>
21 </label>
22 <?php if ( $sub_field['type'] === 'select' ) { ?>
23 <select name="<?php echo esc_attr( $field_name ); ?>[<?php echo esc_attr( $key ); ?>]" id="<?php echo esc_attr( $html_id . '_' . $key ); ?>" <?php FrmComboFieldsController::add_atts_to_input( compact( 'field', 'sub_field', 'key' ) ); ?>>
24 <option value="" class="<?php echo esc_attr( ! empty( $field['placeholder'][ $key ] ) ? 'frm-select-placeholder' : '' ); ?>">
25 <?php echo esc_html( FrmComboFieldsController::get_dropdown_label( compact( 'field', 'key', 'sub_field' ) ) ); ?>
26 </option>
27 <?php
28 foreach ( $sub_field['options'] as $option ) {
29 $selected = (string) $field['value'][ $key ] === (string) $option;
30 $params = array( 'value' => $option );
31
32 if ( 'address' === $field['type'] && 'country' === $key ) {
33 $code = FrmAddressesController::get_country_code( $option );
34
35 if ( $code ) {
36 $params['data-code'] = $code;
37 }
38 }
39
40 FrmHtmlHelper::echo_dropdown_option( $option, $selected, $params );
41 }
42 ?>
43 </select>
44 <?php } else { ?>
45 <input type="<?php echo esc_attr( $sub_field['type'] ); ?>" id="<?php echo esc_attr( $html_id . '_' . $key ); ?>" value="<?php echo esc_attr( $field['value'][ $key ] ); ?>" <?php
46 if ( empty( $remove_names ) ) {
47 echo 'name="' . esc_attr( $field_name ) . '[' . esc_attr( $key ) . ']" ';
48 }
49 FrmComboFieldsController::add_atts_to_input( compact( 'field', 'sub_field', 'key' ) );
50 ?> />
51 <?php
52 }//end if
53
54 if ( $sub_field['label'] ) {
55 FrmComboFieldsController::include_sub_label(
56 array(
57 'field' => $field,
58 'option_name' => $key . '_desc',
59 )
60 );
61 }
62
63 $temp_id = ! empty( $atts['field_id'] ) ? $atts['field_id'] : $field['id'];
64
65 // Don't show individual field errors when there is a combo field error
66 if ( ! empty( $errors ) && isset( $errors[ 'field' . $temp_id . '-' . $key ] ) && ! isset( $errors[ 'field' . $field['id'] ] ) ) {
67 ?>
68 <div class="frm_error" role="alert"><?php echo esc_html( $errors[ 'field' . $temp_id . '-' . $key ] ); ?></div>
69 <?php } ?>
70 </div>
71 <?php
72 }//end foreach
73 ?>
74 </div>
75 </fieldset>
76