-海深不蓝森浓不绿 2019-06-29 14:57 采纳率: 0%
浏览 391
已采纳

选项卡 多个form提交 只能提交一个 怎么解决

图片说明
图片说明
图片说明
图片说明
图片说明

        @using System.Threading.Tasks
        @using HFCore.WebFramework.HtmlExtensions
        @model HFCore.ViewModels.WeiXin.WxAutomaticResponseViewModel
        @{
                ViewData["Title"] = "自动回复";
                Layout = "~/Views/Shared/_Layout.cshtml";
        }
        <section class="content no-padding">
                <div class="row">
                        <div class="col-md-12">
                                <div class="ah-tab-wrapper">
                                        <div class="ah-tab">
                                                <a class="ah-tab-item" data-ah-tab-active="true" href="">文本</a>
                                                <a class="ah-tab-item" href="/WeiXin/WxSubscribeReply/Index">图片</a>
                                                <a class="ah-tab-item" href="">图文</a>
                                                @*/WeiXin/WxSubscribeReply/Index*@
                                        </div>
                                </div>
                                <div class="ah-tab-content-wrapper">
                                        <div class="ah-tab-content" data-ah-tab-active="true">
                                                <form class="form-horizontal" method="post" asp-controller="WxSubscribeReply" enctype="multipart/form-data" asp-action="Index">
                                                        <div class="box-body">
                                                                @Html.AntiForgeryToken()
                                                                @Html.HiddenFor(a => a.Id)
                                                                @Html.HiddenFor(a => a.CreatedOn)
                                                                @Html.HiddenFor(a => a.Deleted)
                                                                @Html.HiddenFor(a => a.CreatorUserId)
                                                                @await Html.PartialAsync("_CreateText")
                                                        </div>

                                                        <div class="box-footer">
                                                                <div class="form-group am-form-warning  am-form-feedback">
                                                                        <div class="col-sm-10 col-sm-push-2">
                                                                                @Html.ValidationSummary(true, "")
                                                                        </div>
                                                                </div>
                                                                <div class="col-md-offset-2">

                                                                        <button type="submit" class="btn btn-flat btn-success" style="width:100px;">保存</button>

                                                                </div>
                                                        </div>
                                                </form>

                                        </div>
                                        <div class="ah-tab-content">
                                                <form class="form-horizontal" method="post" asp-controller="WxSubscribeReply" enctype="multipart/form-data" asp-action="Index">
                                                        <div class="box-body">
                                                                @Html.AntiForgeryToken()
                                                                @Html.HiddenFor(a => a.Id)
                                                                @Html.HiddenFor(a => a.CreatedOn)
                                                                @Html.HiddenFor(a => a.Deleted)
                                                                @Html.HiddenFor(a => a.CreatorUserId)
                                                                @await Html.PartialAsync("_CreateImg")
                                                        </div>
                                                        <div class="box-footer">
                                                                <div class="form-group am-form-warning  am-form-feedback">
                                                                        <div class="col-sm-10 col-sm-push-2">
                                                                                @Html.ValidationSummary(true, "")
                                                                        </div>
                                                                </div>
                                                                <div class="col-md-offset-2">

                                                                        <button type="submit" class="btn btn-flat btn-success" style="width:100px;">保存</button>

                                                                </div>
                                                        </div>
                                                </form>
                                        </div>
                                        <div class="ah-tab-content">
                                                <div class="row">
                                                        <div class="col-md-12">
                                                                <div class="box-header">
                                                                        <div class="form-inline pull-left" id="edittool"></div>
                                                                        <div class="form-inline pull-right">

                                                                        </div>
                                                                </div>
                                                                <div class="box-body">
                                                                        <table id="tbdata"></table>
                                                                </div>
                                                        </div>
                                                </div>
                                        </div>

                                </div>

                        </div>
                </div>
        </section>
  • 写回答

2条回答 默认 最新

  • 消失_很彻底 2019-07-08 18:23
    关注

    两个最简单的方法,
    一个是用iframe,把两个form分别放在一个iframe中,
    第二个方法是用ajax方式来提交,写两个事件就OK了

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥30 c#打开word开启修订并实时显示批注
  • ¥15 如何解决ldsc的这条报错/index error
  • ¥15 VS2022+WDK驱动开发环境
  • ¥30 关于#java#的问题,请各位专家解答!
  • ¥30 vue+element根据数据循环生成多个table,如何实现最后一列 平均分合并
  • ¥20 pcf8563时钟芯片不启振
  • ¥20 pip2.40更新pip2.43时报错
  • ¥15 换yum源但仍然用不了httpd
  • ¥50 C# 使用DEVMOD设置打印机首选项
  • ¥15 麒麟V10 arm安装gdal