Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi davidebr90,

    Sorry about any confusion on that! The {all_fields} Smart tag will only work in the notification email. It requires specific code to be processed, and that’s only run within the Message field of form emails.

    As mentioned in the tutorial you shared, though, you’ll need some custom code to get Smart Tags to process within an HTML field. I haven’t tried Bill’s code, but if for any reason that doesn’t work on other Smart Tags this should do the trick:

    /**
     * Run smart tags within HTML fields.
     *
     * @param array $properties
     * @param array $field
     * @param array $form_data
     * @return array
     */
    function wpf_hidden_field_process_smarttags( $properties, $field, $form_data ) {
    
    	$properties['inputs']['primary']['code'] = apply_filters( 'wpforms_process_smart_tags', $properties['inputs']['primary']['code'], $form_data );
    
    	return $properties;
    }
    add_filter( 'wpforms_field_properties_html', 'wpf_hidden_field_process_smarttags', 10, 3 );
    

    In case it helps, here’s our tutorial on how to add custom code like this to your site.

    Also, there are a bunch of other Smart Tags that are designed to work in the form itself (to use a default values for fields, etc). Here’s our list of available Smart Tags.

    And if you’re up for some custom code, you can even create your own custom Smart Tags.

    I hope this helps! ??

    Thread Starter davidebr90

    (@davidebr90)

    I want to print in forms {field_id=”XX”} (list of previous selected checkbox), but not working any code T_T .

    You have solution?

    PS: Email print correct values

    Hi davidebr90,

    I apologize again for any confusion over the usage here, however we don’t have a way to display a selected option as the user fills out the form. The issue is that all of our Smart Tags use PHP, which won’t process until the form submits. This is why you’d be able to use the {field_id="X"} Smart Tag in the confirmation message or the notification email), which allows the PHP to run.

    It may be possible to do what you’re looking for with JavaScript, which can process on-the-fly (as the user is filling out the form). However, we aren’t able to provide support for this level of customization.

    I’m sorry that we can’t provide quite what you’re looking for here! We’re currently working on an update to our Smart Tags doc (shared above), and I’ve noted that this should be mentioned to hopefully avoid further confusion.

    Thread Starter davidebr90

    (@davidebr90)

    ok…thanks

    Looking for clarity on use of {field_id=”X”} example. My issue may be a bit different in that I’m using a multi-page form and was expecting to display a few field values from the first page in an html field in the second. In this case a ‘submit’ button is being clicked. Is is still case that php is not being called when using multi-page forms?

    Hi joeltek,

    I apologize for any confusion on this, and the {field_id="X"} Smart Tag will not work within a form. This is because our Smart Tags use PHP, rather than JavaScript, so are not designed to pull changing values on the fly (can only pull values that have already been submitted).

    More specifically, you can add {field_id="X"} to a confirmation message or to the settings of a notification email (Subject, Message, etc). These will work because the form has already been submitted at that point, so the PHP is able to run.

    I hope this provides some clarification. Also, there’s an update underway for our Smart Tags tutorial which will share these details and hopefully help to avoid confusion for others in the future.

    I do agree, too, that the ability to easily view details entered on previous pages would be super useful. I’ve added this to our feature request list for consideration down the road.

    Last, please know that if you have access to multipage forms (a paid license feature), you also have access to our private email support. There, we’re able to provide faster and more in-depth support for our paid license holders.

    Thanks!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘echo / display smart tag in html field is possible?’ is closed to new replies.