我正在尝试在CreateTopic表单中添加表情符号按钮。
这是我的CreateTopic页面的HTML:
@using Reddit.Models
@model CreateTopicViewModel
<div class="row">
<div class="col-md-6 col-md-offset-3">
<section id="postForm">
@using (Html.BeginForm("CreateTopic", "Home", FormMethod.Post, new { @class = "form-horizontal", role = "form" }))
{
<div class="form-group">
@Html.LabelFor(x => x.Name, new { @class = "control-label" })
@Html.TextBoxFor(x => x.Name, new { @class = "form-control" })
</div>
<button type="button" name="useEmoji"><i class="em em---1"></i></button>
<div class="form-group">
@Html.LabelFor(x => x.Content, new { @class = "control-label" })
@Html.TextAreaFor(x => x.Content, new { @class = "form-control", @rows = "8" })
</div>
<button type="submit" name="postTopic" class="btn btn-block btn-primary">Post Topic</button>
}
</section>
</div>
</div>
我读到不可能制作嵌套表单所以我唯一的想法是创建一个ButtonHandler操作,每次调用表情符号按钮或Post Topic按钮时都会调用它来检查是否点击了Post Topic按钮或表情符号,但IMO不会很顺利。 我该怎么办呢?提前谢谢!