I have three different form and I want different Message for all three of them. I am not sure If I can get that from Language file. I get the text "Form Posted" on successfuly form submission.
You might be better off having a property on the page for the message, then just showing the message and hiding the XForm (if that's what you want to do) after the form is submitted. There's not a lot of support within the EPiServer XForms context to customize the error or success messages. You can control some of the text via language files, but obviously that won't work if you want it customized on a per-form basis.
Thanks Chris. I was thinking I could customise the message somewhere. But I could not find this "Form Posted" message in lang files.
Hi, Robert,
For EPi 7.5: the text is in you VPP Modules/CMS/Util/Views/Shared/DisplayTemplates/XForm.ascx.
For EPi 7.1: the text is in C:\Program Files (x86)\EPiServer\CMS\7.0.586.1\Application\Util\Views\Shared\DisplayTemplates.
What you could do, if you are using MVP is to override XForm in DisplayTemplates or you can render it differently on the page/block itself by including your own Html.BeginForm, etc, so instead of using Html.PropertyFor, you render the content of XForm.ascx slightly different:
<% if (ViewData["XFormActionResult"] is EPiServer.Web.Mvc.XForms.XFormSuccessActionResult) { %>
<strong>Write your own success msg here</strong>
<% } else { %>
<% using (Html.BeginXForm(Model, htmlAttributes: new { @class = "form xform" })) { %>
<% if (Model != null){ %>
<% foreach (HtmlFragment fragment in (IEnumerable<HtmlFragment>)ViewData["XFormFragments"] ?? Model.CreateHtmlFragments()) {%>
<%: Html.Fragment(fragment)%>
<% }
} %>
<% } %>
<% } %>
Hope this helps!
Marija
Thanks! I have solved it in a similar way. Found this: http://world.episerver.com/Forum/Developer-forum/EPiServer-7-CMS/Thread-Container/2013/8/Modifying-XForms-Markup/
By default after form post we get message "Form Posted" . How can we change this message?