Im having issues with submissions not being assigned to $value. When I print_r
value in the get_field_input() method and make a submission it shows up as blank but the values are there in _POST.
This leads to the form thinking there’s no form input being made. Guidance would be much appreciated.
public function get_field_input( $form, $value = '', $entry = null) {
if ($this->is_form_editor()) {
return '';
}
$is_entry_detail = $this->is_entry_detail();
$is_form_editor = $this->is_form_editor();
$is_admin = $is_form_editor || $is_entry_detail;
$consent_type = $this->consentType;
$consent_title = get_the_title($post = $consent_type);
$html_input_type = 'checkbox';
$id = (int) $this->id;
$tabindex = $this->get_tabindex();
$disabled_text = $is_form_editor ? 'disabled="disabled"' : '';
$required_attribute = $this->isRequired ? 'aria-required="true"' : '';
$invalid_attribute = $this->failed_validation ? 'aria-invalid="true"' : 'aria-invalid="false"';
$label = $this->checkboxLabel;
$target_input_id = parent::get_first_input_id( $form );
$for_attribute = empty( $target_input_id ) ? '' : "for='{$target_input_id}'";
$label_class_attribute = 'class="gfield_sufs_consent_label"';
$required_div = ( $this->labelPlacement === 'hidden_label' && ( $is_admin || $this->isRequired ) ) ? sprintf( "<span class='gfield_required'>%s</span>", $this->isRequired ? '*' : '' ) : '';
// $checked = $is_form_editor ? '' : checked( '1', $value[ $id . ".1" ], false );
$input = "
<input name='input_{$id}.1' id='{$target_input_id}' type='{$html_input_type}' value='1' {$tabindex} {$required_attribute} {$invalid_attribute} {$disabled_text} />
<label {$label_class_attribute} {$for_attribute} >{$label} </label>{$required_div}
<input type='hidden' id='input_{$id}.2' name='input_{$id}.2' value='{$consent_type}'>
<input type='hidden' id='input_{$id}.3' name='input_{$id}.3' value='{$consent_title}'>
";
$css_class = 'tooltip';
$tooltip_class = '';
$tooltip_text = '123';
$input .= "<a href='#' onclick='return false;' onkeypress='return false;' class='gf_tooltip tooltip_form_field_admin_label " . esc_attr( $css_class ) . " {$tooltip_class}' title='" . esc_attr( $tooltip_text ) . "'><i class='fa fa-question-circle'></i></a>";
// echo '<pre>';
// print_r( $_POST );
// echo '</pre>';
return sprintf( "<div class='ginput_container ginput_container_sufs_consent'>%s</div>", $input );
}