Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hello,
I'm not sure what I may have done wrong here, but I'm getting two Submit buttons when adding a form via a macro to rich text box. This happens when I click "Save" or "Save and Publish".
The code generated after Save is as follows:
<div class="umb-macro-holder CommentForm mceNonEditable"><!-- <?UMBRACO_MACRO macroAlias="CommentForm" /> --> <ins><div class="form-group"></div><div class="form-group"></div><div class="form-group"></div><button class="btn btn-default">Submit</button> </ins></div><div class="form-group"></div><div class="form-group"></div><p><button class="btn btn-default">Submit</button></p>
The code in my Comment Form is as follows:
@model UmbracoSurfaceControllers.Models.CommentFormViewModel@if (TempData["success"] == null){ using (Html.BeginUmbracoForm("HandleFormSubmit", "CommentsFormSurface")) { <div class="form-group"> @Html.TextBoxFor(m => m.Name, new { @class = "form-control", placeholder = "Name" }) @Html.ValidationMessageFor(m => m.Name) </div> <div class="form-group"> @Html.TextBoxFor(m => m.Email, new { @class = "form-control", placeholder = "Email address" }) @Html.ValidationMessageFor(m => m.Email) </div> <div class="form-group"> @Html.TextAreaFor(m => m.Comment, new { @class = "form-control", placeholder = "Your comment" }) @Html.ValidationMessageFor(m => m.Comment) </div> <button id="comment-submit" type="submit" class="btn btn-default">Submit</button> }}else{ <p>Thank you</p>}
In my Comment Form macro I have code as follows:
@inherits Umbraco.Web.Macros.PartialViewMacroPage@Html.Action("Index", "CommentsFormSurface")
Any ideas why this might be happening?
Much appreciated,
Henry
Hi Henry,
Did you try to remove second submit button from generated code ?
I can suppose that one of buttons is default and not needed on your form.
THanks,
Alex
Hi Alex,
Yes - tried manually removing the additional code; however on re-publishing, the additional button re-appears.
I re-placed the <button> with an <input> control, and it isn't doing it any more. So all is good.
Cheers,
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
Macro two submit buttons on Save and Publish
Hello,
I'm not sure what I may have done wrong here, but I'm getting two Submit buttons when adding a form via a macro to rich text box. This happens when I click "Save" or "Save and Publish".
The code generated after Save is as follows:
The code in my Comment Form is as follows:
In my Comment Form macro I have code as follows:
Any ideas why this might be happening?
Much appreciated,
Henry
Hi Henry,
Did you try to remove second submit button from generated code ?
I can suppose that one of buttons is default and not needed on your form.
THanks,
Alex
Hi Alex,
Yes - tried manually removing the additional code; however on re-publishing, the additional button re-appears.
I re-placed the <button> with an <input> control, and it isn't doing it any more. So all is good.
Cheers,
Henry
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.