I have a form which is meant to record the sender's IP address in a hidden field using "[@Remote_Addr]" as it's Default Value in the field's settings.
This field is always empty in both the page source and the sent email.
The form.cshtml correctly displays the IP address in text, i.e. "Your IP address will be recorded as 123.123.1.2". To get that I inject Microsoft.AspNetCore.Http.IHttpContextAccessor HttpContextAccessor
and output the IP address with @HttpContextAccessor.HttpContext.Connection.RemoteIpAddress.ToString()
Because it displays correctly on the page I suspect something is amiss with the way UF accesses it.
Any advice would be appreciated. I'll raise an issue on GitHub if it's not just me ;)
Remote_Addr Magic String Not Working
Umb 9.1.2 UF 9.2.0-rc001 hosted on Windows.
I have a form which is meant to record the sender's IP address in a hidden field using "[@Remote_Addr]" as it's Default Value in the field's settings.
This field is always empty in both the page source and the sent email.
The form.cshtml correctly displays the IP address in text, i.e. "Your IP address will be recorded as 123.123.1.2". To get that I inject
Microsoft.AspNetCore.Http.IHttpContextAccessor HttpContextAccessor
and output the IP address with@HttpContextAccessor.HttpContext.Connection.RemoteIpAddress.ToString()
Because it displays correctly on the page I suspect something is amiss with the way UF accesses it.
Any advice would be appreciated. I'll raise an issue on GitHub if it's not just me ;)
Rgds,
Craig
https://github.com/umbraco/Umbraco.Forms.Issues/issues/685 raised to cover
is working on a reply...