• Resolved hakxxaw

    (@hakxxaw)


    PLZ HELP. I created a form using forminator. I made it in such a way that certain fields are hidden when the user selects “NO” on a confirmation field. The hidden fields contain placeholders and values by default which are “NA” by default so that when i print click submit and download the pdf form the results on the hidden fields should sttill be written “NA” in them. However this is not the issue because everytime i click “NO” on the confirmation field and print out the pdf, the hidden fields are always empty. Pls if anyone out there can assist, pls help me.!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Amin – WPMU DEV Support

    (@wpmudev-support2)

    Hello @hakxxaw ,

    Would you mind sharing your form with us so we can check this issue closer? Please see here how to export it https://wpmudev.com/docs/wpmu-dev-plugins/forminator/#import-export

    When you have exported the form please share it with us using pastebin.com or a service like gdrive.

    kind regards,
    Kasia

    Plugin Support Dmytro – WPMU DEV Support

    (@wpmudevsupport16)

    Hey @hakxxaw,

    There’s no option for the default field values when they are conditionally hidden or empty, and the placeholders won’t be used as values in such cases.

    You can also try applying the following PHP snippet and see if it helps:

    <?php
    
    if ( ! defined( 'ABSPATH' ) || ( defined( 'WP_CLI' ) && WP_CLI ) ) {
    	return;
    }
    
    add_filter( 'forminator_entry_meta_value_to_string', function( $string_value, $field_type, $meta_value ) {
    
    	if ( empty( $meta_value ) ) {
    	    // Set default values for empty / conditionally hidden fields:
    		$string_value = 'NA';
    	}
    	return $string_value;
    }, 10, 3 );

    – save it as a PHP file, e.g. forminator-default-value.php, and upload it to /wp-content/mu-plugins/ directory on the server, so that it runs as a must use plugin.

    If you need to change the default text, replace “NA” with your text on this line:

    $string_value = 'NA';

    Best Regards,
    Dmytro

    Plugin Support Amin – WPMU DEV Support

    (@wpmudev-support2)

    Hello @hakxxaw ,

    We haven’t heard from you for over a week now, so it looks like you no longer need our assistance.

    Feel free to re-open this ticket if needed.

    Kind regards
    Kasia

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Forminator issue!’ is closed to new replies.