Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @using Sitecore.Globalization
- @model FormModel
- @{
- var id = "Form" + Model.ShortFormId;
- }
- <div class="layout layout-a">
- <div class="region region-a">
- <div class="region-inner">
- <div class="block block-size-a">
- @if (Model.ShowTitle) {
- <h4>@Html.Sitecore().Field("Title", Model.InnerItem)</h4>
- }
- @if (Model.ShowIntroduction) {
- @Html.Sitecore().Field("Introduction", Model.InnerItem)
- }
- @if (Model.ShowTitle || Model.ShowIntroduction) {
- <div class="divider"></div>
- }
- <div class="form form-vertical form-style-a form-validate form-vertical-style-a">
- @using (Html.BeginRouteForm(MvcSettings.SitecoreRouteName, FormMethod.Post, new { enctype = "multipart/form-data", id = Model.ID.ToShortGuid(), autocomplete = "off" }))
- {
- Html.EnableClientValidation(true);
- Html.EnableUnobtrusiveJavaScript(true);
- @Html.AntiForgeryToken()
- @Html.Sitecore().FormHandler()
- @Html.Hidden(Constants.FormId, Model.ID.ToString())
- if (Model.IsAjaxMvcForm)
- {
- <script>
- if (typeof ($scw) === "undefined") {
- window.$scw = jQuery.noConflict(true);
- }
- $scw(document).ready(function () {
- $scw("#@Model.ID.ToShortGuid()").ajaxForm({ targetId: "@id" });
- });
- </script>
- }
- if (Model.Failures != null && Model.Failures.Count > 0)
- {
- // TODO: Markup for validation summary?
- <div class="form-validation-summary">
- @foreach (var failure in Model.Failures)
- {
- <span class="error-message">@Html.Encode(failure.ErrorMessage)</span>
- }
- <br />
- </div>
- }
- if (Model.SuccessSubmit) {
- <p>
- @Html.Encode(!string.IsNullOrEmpty(Model.SuccessMessage) ? Model.SuccessMessage : Translate.Text("Default success message."))
- </p>
- }
- else {
- <div class="form-validation-summary">
- @*TODO: Markup for validation summary?*@
- @Html.ValidationSummary(false)
- </div>
- @Html.EditorFor(x => Model.Sections)
- <button class="btn btn-style-a">
- @Model.SubmitName
- <i class="icon icon-arrow-right"></i>
- </button>
- }
- if (Model.ShowFooter && !Model.Footer.IsWhiteSpaceOrNull())
- {
- <div class="contact-smallprint">
- @Html.Sitecore().Field("Footer", Model.InnerItem)
- </div>
- }
- }
- </div>
- </div>
- </div>
- </div>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement