【发布时间】:2021-01-24 07:33:04
【问题描述】:
我需要向我的 servlet 提交一个表单,同时在我的 .jsp 文件中打开一个带有输入标签的 BootStrap 模式。但是,如果我将输入标记类型设置为“按钮”,则无法将表单提交到我的 servlet。如果我将类型设置为“提交”,则 BootStrap 模式不起作用。我可以一键完成这两个功能吗?
谢谢!
<FORM METHOD="post" ACTION="<%=request.getContextPath()%>/PostController" id="getOneForUpdateForm">
<input class="btn" type="button" data-toggle="modal" data-target="#exampleModal" value="editPost">
<input type="hidden" name="postno" value="${postVO.postno}">
<input type="hidden" name="action" value="getOne_For_Update">
</FORM>
这里是 BootStrap 模式
<!-- Modal -->
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Edit the Post</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Save Changes</button>
</div>
</div>
【问题讨论】:
标签: javascript html jsp