I am using a vanilla implementation of the Umbraco registration snippet (which uses UmbRegisterController). I want to include custom input fields in the form, but these values simply need to be passed to the page the form is submitted to. E.g. I have Umbraco Member fields, and also vanilla html fields:
// Umbraco Member Registration form field:
@Html.TextBoxFor(m => registerModel.Email)
// Plain old HTML form field:
<input type='text' name='someCustomField'>
And I want to be able to access someCustomField on the next/submission page like this:
if (TempData["FormSuccess"] != null) {
<span>You entered:</span>
<span>@Request.Form["someCustomField"]</span>
}
But the Request object has no Form values. Are these in TempData? How can I get the value for someCustomField ?
As of yet, I've been unable to achieve this myself. One option might be to create a custom workflow and see if you can add the information into temp data from there. However I'm not 100% sure that this will work.
During the submission process, if the form is successfully submitted the temp data is all cleared out. I believe that Umbraco Forms needs to be updated so that if it is successful it should store the submission reference in Temp Data. It would make out lives much easier.
How to access form data after registration
I am using a vanilla implementation of the Umbraco registration snippet (which uses
UmbRegisterController
). I want to include custom input fields in the form, but these values simply need to be passed to the page the form is submitted to. E.g. I have Umbraco Member fields, and also vanilla html fields:And I want to be able to access
someCustomField
on the next/submission page like this:But the
Request
object has noForm
values. Are these inTempData
? How can I get the value forsomeCustomField
?Hi Joshua,
As of yet, I've been unable to achieve this myself. One option might be to create a custom workflow and see if you can add the information into temp data from there. However I'm not 100% sure that this will work.
During the submission process, if the form is successfully submitted the temp data is all cleared out. I believe that Umbraco Forms needs to be updated so that if it is successful it should store the submission reference in Temp Data. It would make out lives much easier.
Cheers,
Nik
Creating a custom controller to replace
UmbRegisterController
allowed me to accessRequest.Form["attr"]
.@Nik - You were correct, I can then set
TempData
to pass back form data to the redirect/result page. This looks like:CustomRegisterController
ResultView
is working on a reply...