Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at

  • Bijesh Tank 184 posts 411 karma points
    Aug 18, 2016 @ 08:47
    Bijesh Tank

    Capture current page name on submission


    I have a form that is reused on quite a few pages and we would like to capture the page where the form submission has come from, and then show the entry (in the backoffice) with the page name. Is this possible?

    I was thinking about including a hidden field as part of the form as a new question in the backoffice but then how can I pass the current page name to that hidden field?

    Thanks, B.

  • Warren Buckley 2062 posts 4416 karma points admin mvp hq c-trib
    Aug 18, 2016 @ 14:26
    Warren Buckley

    Hi Bijesh,
    We log the node ID of the page for the submission, but currently do not display the page name or URL that it was posted from.

    You could use a hidden field as you describe and use a default value in the field along with the Forms syntax. Hopefully this should be enough to achieve what you need to do.


    Warren :)

  • Bijesh Tank 184 posts 411 karma points
    Aug 18, 2016 @ 15:10
    Bijesh Tank

    Thanks for the pointer Warren!

    Works like a charm :)

  • Mads Sørensen 171 posts 355 karma points
    Sep 18, 2017 @ 17:52
    Mads Sørensen

    Hi Warren - is it possible for you to explain this a bit?

    I've have tried ti paste this into the default value field but with no luck:



    But that dosent seem to do the job.

    What am I doing wrong?enter image description here

  • Martin 251 posts 610 karma points
    Nov 22, 2017 @ 11:25

    Hi Mads,

    Did you get the hidden field to return the page name?

    *Edit - I've figured it out and used the [#nodeProperty] in the hidden field. Replacing [#nodeProperty] with [#pageName]

  • Mads Sørensen 171 posts 355 karma points
    Nov 22, 2017 @ 13:01
    Mads Sørensen

    Hey Martin - i figured it out - But thanks :D

  • jonok 246 posts 439 karma points
    Jun 07, 2017 @ 23:09

    I'm currently trying to do this in Umbraco Forms - but I don't understand Warren's instructions. Is there an easy way to display the page name in the email subject or body? This is important, as my client wants to know which pages are being used to submit a single form that appears throughout the website.

  • Martin 251 posts 610 karma points
    Jul 11, 2017 @ 13:10

    Hi, @Bijesh & @jonok, did you get the page name returned in the form entry?

    Thanks M

  • jonok 246 posts 439 karma points
    Jul 11, 2017 @ 23:00

    Hi Martin, I ended up getting it to work by doing the following (it's a bit convoluted)...

    Add a metatag to the head of each page, and insert the page name into the 'content' of the metatag:

    <meta name="" content="@Model.Content.Name">

    Then in Umbraco Forms, I include a question of type 'hidden' in each of the forms, and I give the question a title of 'Page Name'.

    Then in the footer of each page, I use jquery to get the page name from the metatag and insert it into the hidden form input:

    if($('.pagename').length) {
          var pageName = $("meta[name='']").attr('content');
          $(".pagename input").val(pageName);

    Now when the form is submitted, the page name is included in the email along with the rest of the form data.

    It's not the most elegant solution, but it works - which is the important thing.

Please Sign in or register to post replies

Write your reply to: