Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi,
We need add extra data to each saved form entry. We must collect tracking data from our affiliates.
I can create hidden form fields thru C# and populate their values from JS.
But how do i add the data to each saved form entry, without having to add the field types on each created form in the backoffice?
I tried looking into RecordSavingNotification, but cant figure out how to use this.
I tried this approach on form.cshtml for a theme. Unfortunately thats dosnt add the field to the form. It adds it on the frontend.
What i actually would like is to add my fields to each saved record. Maybe i need to do it someplace else. Can anyone point me in the right direction?
Its Umbraco 10.
var ipGuid = Guid.NewGuid().ToString(); FieldViewModel mm = new FieldViewModel() { Alias = ipGuid.ToString(), FieldTypeName = "HiddenField", Id = ipGuid, Mandatory = false, PlaceholderText = "MYIP", Name = ipGuid, Validate = false, FormId = Model.FormId, Caption = "MYIP", FieldsetId = Guid.Parse(Model.CurrentPage.Fieldsets[0].Id), Values = new List<string>() { "TEST VAL" }, FieldType = new Umbraco.Forms.Core.Providers.FieldTypes.HiddenField(), }; Model.Pages.First().Fieldsets.First().Containers.First().Fields.Add(mm);
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
umbraco forms add extra data to saved entry
Hi,
We need add extra data to each saved form entry. We must collect tracking data from our affiliates.
I can create hidden form fields thru C# and populate their values from JS.
But how do i add the data to each saved form entry, without having to add the field types on each created form in the backoffice?
I tried looking into RecordSavingNotification, but cant figure out how to use this.
I tried this approach on form.cshtml for a theme. Unfortunately thats dosnt add the field to the form. It adds it on the frontend.
What i actually would like is to add my fields to each saved record. Maybe i need to do it someplace else. Can anyone point me in the right direction?
Its Umbraco 10.
is working on a reply...