search
AI OnAI Off
A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More.
Hi,
Yes, you can read other fields data during element validation. Example:
var submitData = HttpContext.Current.Request.HttpMethod == "POST" ? HttpContext.Current.Request.Form : HttpContext.Current.Request.QueryString;
then you can get a specific element value by using: submitData["__field_123"]. The __field_123 is element name, you can get element name from element content link via extension method:
public static string GetElementName(this ContentReference elementLink)
{
return string.Format("{0}{1}", Constants.ElementIdPrefix, elementLink);
}
/DT
Add my 2cents, the (internal) extension has already existed in
namespace EPiServer.Forms.Helpers.Internal
static class FormsExtensions
public static string GetElementName(this ContentReference elementLink)
Hi,
I'd like to create a custom form element with validation, so that validation checks other values from the same form.
Is it possible to read data from other fields during element validation? If so, how can I access the data?
Thanks in advance!