Take the community feedback survey now.
                AI OnAI Off
            
        Take the community feedback survey now.
 
                Btw. There's a bug in the code above. Don't mind it.
return Success(currentPage, currentPage);
Should be
return Success(currentPage, xFormPostedData);
I had to clean up the code and just copypasted it incorrectly.
Hi Marko
Could you please send some details on how you used the XFormPageUnknownActionHandler?
 
    
    
    
Hi!
I've managed to build nice little custom validation for my MVC/XForm page. I added recaptcha validation which works nicely. But what doesn't work is that all the input-fields in the form are blank after validation fails (for example, user hasn't provided valid email). I want those fields to contain the same value user entered after post.
Here's some code. This is from the view. Model.Page.Form property contains the XForm object.
@Html.PropertyFor(m => m.Page.Form, new { XFormParameters = new EPiServer.XForms.Util.XFormParameters() { PostAction = "Post", SuccessAction = "Success", FailedAction = "Failed"} })This is from the controller.
[AcceptVerbs(HttpVerbs.Post)] public virtual ActionResult Post(FormPage currentPage, XFormPostedData xFormPostedData) { VerifyRecaptcha() if (ModelState.IsValid) { var data = new XFormPageHelper().GetXFormData(this, xFormPostedData); XFormActionHelper.DoAction(data, xFormPostedData, true); return Success(currentPage, currentPage); } return Failed(currentPage, xFormPostedData); } [AcceptVerbs(HttpVerbs.Post)] public virtual ActionResult Success(FormPage currentPage, XFormPostedData xFormPostedData) { return Redirect("/to/other/page"); } [AcceptVerbs(HttpVerbs.Post)] public virtual ActionResult Failed(FormPage currentPage, XFormPostedData xFormPostedData) { return Index(currentPage); }How do I tell XForm object to render user posted data back to user in Failed-method?