Hi all,
I have the following excerpts inside a class that extends GF_Field
:
<?php
class DDMWGF_Field_Authority extends GF_Field {
public function __construct( $data = array() ){
parent::__construct( $data );
$this->add_hooks();
}
public function add_hooks(){
add_action('gform_editor_js_set_default_values', array($this, 'js_set_default_values' ) );
add_action('gform_field_standard_settings', array($this, 'tab_content'), 10, 2);
}
public function js_set_default_values() {
?>
case "<?php echo $this->type; ?>" :
field.label = <?php echo json_encode( esc_html(DDMWGF_DDA) ); ?>;
field.checkboxLabel = "<?php echo DDMWGF_DDA_AGREE; ?>";
field.isRequired = true;
break;
<?php
}
public function tab_content( $placement, $form_id ){
if($placement === -1){
?>
<li class="ddmwgf_link_fields field_setting">
<label for='field_link_ddmwgf_bsb' >
<?php echo DDMWGF_BSB; ?>
<?php gform_tooltip( "form_field_link_ddmwgf_bsb" ) ?>
</label>
<select id='field_link_ddmwgf_bsb' onBlur="SetFieldProperty( 'field_link_ddmwgf_bsb', this.value);">
<!-- automatically filled using JavaScript -->
</select>
</li>
<li class="ddmwgf_link_fields field_setting">
<label for='field_link_ddmwgf_acc' >
<?php echo DDMWGF_ACC; ?>
<?php gform_tooltip( "form_field_link_ddmwgf_acc" ) ?>
</label>
<select id='field_link_ddmwgf_acc' onBlur="SetFieldProperty( 'field_link_ddmwgf_acc', this.value);">
<!-- automatically filled using JavaScript -->
</select>
</li>
<li class="ddmwgf_link_fields field_setting">
<label for='field_link_ddmwgf_name' >
<?php echo DDMWGF_NAME; ?>
<?php gform_tooltip( "form_field_link_ddmwgf_name" ) ?>
</label>
<select id='field_link_ddmwgf_name' onBlur="SetFieldProperty( 'field_link_ddmwgf_name', this.value);">
<!-- automatically filled using JavaScript -->
</select>
</li>
<li class="ddmwgf_link_fields field_setting">
<label for='field_link_ddmwgf_cusname' >
<?php echo DDMWGF_CUSTOMER_NAME; ?>
<?php gform_tooltip( "form_field_link_ddmwgf_cusname" ) ?>
</label>
<select id='field_link_ddmwgf_cusname' onBlur="SetFieldProperty( 'field_link_ddmwgf_cusname', this.value);">
<!-- automatically filled using JavaScript -->
</select>
</li>
<li class="ddmwgf_link_fields field_setting">
<label for='field_link_ddmwgf_cusaddr' >
<?php echo DDMWGF_CUSTOMER_ADDRESS; ?>
<?php gform_tooltip( "form_field_link_ddmwgf_cusaddr" ) ?>
</label>
<select id='field_link_ddmwgf_cusaddr' onBlur="SetFieldProperty( 'field_link_ddmwgf_cusaddr', this.value);">
<!-- automatically filled using JavaScript -->
</select>
</li>
<li class="ddmwgf_link_fields field_setting">
<label for='field_link_ddmwgf_cusemail' >
<?php echo DDMWGF_CUSTOMER_EMAIL; ?>
<?php gform_tooltip( "form_field_link_ddmwgf_cusemail" ) ?>
</label>
<select id='field_link_ddmwgf_cusemail' onBlur="SetFieldProperty( 'field_link_ddmwgf_cusemail', this.value);">
<!-- automatically filled using JavaScript -->
</select>
</li>
<li class="ddmwgf_link_fields field_setting">
<label for='field_link_ddmwgf_cusphone' >
<?php echo DDMWGF_CUSTOMER_PHONE; ?>
<?php gform_tooltip( "form_field_link_ddmwgf_cusphone" ) ?>
</label>
<select id='field_link_ddmwgf_cusphone' onBlur="SetFieldProperty( 'field_link_ddmwgf_cusphone', this.value);">
<!-- automatically filled using JavaScript -->
</select>
</li>
<?php
}
}
}
(I’ve left out the rest of the class for clarity as this is the problem code)
Can anyone identify why these fields are appearing 3 consecutive times like below?