Change form field value during _FormValidate event
Is it possible to change a form value during the UmbracoFormsController.FormValidate event? I have a hidden form field that needs to get populated with a formatted string based on other field entries.
Can you provide a small code snippet for this?
I've tried returning the field and setting its Values property, but that doesn't work.
var field = e.Form.AllFields.SingleOrDefault(f => f.Alias == "key");
field.Values = new List<object> { "test" };
It does set the value during the request, but does not save to DB or fill in the form field when posting back (on model validation error).
Change form field value during _FormValidate event
Is it possible to change a form value during the UmbracoFormsController.FormValidate event? I have a hidden form field that needs to get populated with a formatted string based on other field entries.
Can you provide a small code snippet for this?
I've tried returning the field and setting its Values property, but that doesn't work.
It does set the value during the request, but does not save to DB or fill in the form field when posting back (on model validation error).
is working on a reply...