想要点击修改按钮赋值给修改按钮,然后打开模态框传给表单,为什么我怎么传都传不进去,我是哪里步骤出问题了呢?
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
<meta charset="utf-8"/>
<title>会员信息维护-首页</title>
<style type="text/css">
.myposition {
position: relative;
left: 280px; }
</style>
<script type="text/javascript" src="/vip/jquery/jquery-3.3.1.min.js"></script>
<link type="text/css" rel="stylesheet" href="/vip/bootstrap/css/bootstrap.min.css"/>
<script type="text/javascript" src="/vip/bootstrap/js/bootstrap.min.js"></script>
</head>
<body>
<script>
$('#updateModal').on('show.bs.modal', function(event) {
** modal.find('#ex1').val(name)**
})
</script>
<div class="modal fade" id="updateModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-body">
<form class="form-inline">
<div class="form-group">
<label class="sr-only" >表单1</label>
<input type="text" class="form-control" **id="ex1"** value="" placeholder="表单1">
</div>
</form>
</div>
<form method="post" action="<%=request.getContextPath()%>/dormitoryAdmin?method=search">
<div class="myposition" style="top: 60px;">
<table class="table table-condensed">
<tr>
<th>修改按钮</th>
</tr>
<c:forEach items="${list}" var="dormitoryAdmin" varStatus="vs">
<tr>
<td>
<div class="hidden-sm hidden-xs btn-group">
<a class="btn btn-sm btn-info" data-toggle="modal" data-target="#updateModal"
**data-name="${dormitoryAdmin.SFZ}"**
>
<i class="glyphicon glyphicon-pencil"></i>
</a>
</div>
</td>
</tr>
</c:forEach>
</table>
</div>
</body>
</html>