根据下面提到的代码,会有两个下拉列表(1个用于添加到板球(将提到所有学生),第2个用于从Cricket团队中删除学生)并且有2个提交按钮(1个用于添加学生到板球和第二是删除学生)。如果我选择Add Student下拉列表并单击Add Button,则应该成功提交。
<label class="labelcss" for="exampleInputEmail1"> Student to Add for Cricket : </label> <form:select path="studentId">
<form:option value="0" label="Select a Student " />
<c:forEach items="${studentList}" var="student">
<option value="${student.studentId}">${student.studentName}</option>
</c:forEach>
</form:select>
<br><br>
<br>
<label class="labelcss" for="exampleInputEmail1"> Student to Remove from Cricket Team: </label>
<form:select path="studentId" >
<form:option value="0" label="Select a Student " />
<c:forEach items="${studentsList}" var="students">
<option value="${students.studentId}">${students.studentName}</option>
</c:forEach>
</form:select>
<button type="submit" name ="add"class="btn btn-primary">Add</button>
<button type="submit" name ="remove"class="btn btn-primary">Remove</button>
如果上下文不清楚或代码不够,请回复...谢谢。