Copied to clipboard

Flag this post as spam?

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


  • Michelle 12 posts 122 karma points
    May 04, 2019 @ 19:28
    Michelle
    0

    How to set hidden field value to the IP address of the user?

    I need to capture the user's IP address and set the value in a hidden field. How would you advise I would go about this?

    I have tried the simple way of adding the following variable in the default field:

    {@record.IP}
    

    but this returns an empty value. I don't really want to make a query to Umbraco's UFReords table. Is there something I need to add to allow this magic string to work?

    Thank you in advance.

  • Søren Mastrup 122 posts 564 karma points c-trib
    May 05, 2019 @ 10:06
    Søren Mastrup
    104

    You should be able to fetch the users current IP with [@Remote_addr]. If the IP is saved in a field of a member, you could use {member.FOO}.

    Documentation on magic strings can be found here: https://our.umbraco.com/documentation/Add-ons/umbracoforms/developer/Magic-Strings/

Please Sign in or register to post replies

Write your reply to:

Draft