• Resolved Design Lobby

    (@designlobby)


    Hi there!

    I am generating a hidden field with the following:

    add_filter( 'hf_form_markup', function( $markup ) {
        $markup .= '<input name="hiddenFieldUrl" type="hidden" id="hiddenFieldUrl" />';
        return $markup;
    });

    This produces:

    <input name=”hiddenFieldUrl” type=”hidden” id=”hiddenFieldUrl” />

    I am then adding markup value="<-- the-form-URL -->" via javascript.

    I cannot seem to add this hidden field to my notification emails. How would I go about doing this? I have tried adding [hiddenFieldUrl] but no luck!

    Many thanks,

    DL

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

    Is there a specific reason for adding this hidden field via a filter?
    Can you try just adding the hidden field via the fields tab in the form settings instead?

    Hope that helps. If you have any questions, please let me know!

    Thread Starter Design Lobby

    (@designlobby)

    Hi Lap,

    Yes this works, thanks.

    I was using the filter to avoid the field being removed by client mistake. I assumed that if you have a filter available to add fields then these fields would be available to include in the email notifications?

    Alternatively, is there a way to include the referring URL in the email notifications? I can see this info is stored when visiting submissions in admin.

    No worries if not. Thanks for your help.

    DL

    I’ve created a feature request here: https://github.com/ibericode/html-forms/issues/79

    If/when we will be able to create this feature I can’t say yet.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Adding hidden field value to notification email’ is closed to new replies.