我有这个注册表单,点击提交按钮时
<form action="viewReg.php">
将使用bootstrap模式弹出。我将在表格上输入的价值一起。我已经知道如何从输入字段中获取这些值。我只想用模态viewReg.php
我试过http://getbootstrap.com/2.3.2/javascript.html#modals 但它没有使用表格的外部链接指南。
修改 有两页.. Registration.html和viewReg.php
我是编码的新手。
<form action="viewRegistration.php" method="post" >
<!-- Table -->
<table class="table">
<tr>
<td>USN</td>
<td><input type="text" name="usn" placeholder="USN #"></td>
</tr>
<tr>
<td>First Name</td>
<td><input type="text" name="firstname" placeholder="First Name" style="text-transform: capitalize;"></td>
</tr>
<tr>
<td>Last Name</td>
<td ><input type="text" name="lastname" placeholder="Last Name" style="text-transform: capitalize;"></td>
</tr>
<tr>
<td>Email</td>
<td><input type="text" name="email" placeholder="Email Address"></td>
</tr>
<tr>
<td>Birthday</td>
<td><input type="text" id="datepicker" name="datepicker" placeholder="Your Birthday"></td>
</tr>
<tr>
<td>Place of Birth</td>
<td>
<select name="pob">
<option value="Manila">Manila</option>
</select>
</td>
</tr>
<tr>
<td>Course</td>
<td><select name="course">
<option value="Bachelor of Science in Information Technology">BS in Information Technology</option>
</select>
</td>
</tr>
</table>
</div>
<input type="reset" value="Reset" class="btn btn-primary"> <input type="submit" value="Submit" class="btn btn-primary">
</form>
答案 0 :(得分:1)
这里有一个关于如何使用带有bs3模态的表单的例子:
<强> Live Demo 强>
<!-- Button trigger modal -->
<button class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModalNorm">
Launch Normal Form
</button>
<!-- Modal -->
<div class="modal fade" id="myModalNorm" tabindex="-1" role="dialog"
aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<!-- Modal Header -->
<div class="modal-header">
<button type="button" class="close"
data-dismiss="modal">
<span aria-hidden="true">×</span>
<span class="sr-only">Close</span>
</button>
<h4 class="modal-title" id="myModalLabel">
Modal title
</h4>
</div>
<!-- Modal Body -->
<div class="modal-body">
<form role="form">
<div class="form-group">
<label for="exampleInputEmail1">Email address</label>
<input type="email" class="form-control"
id="exampleInputEmail1" placeholder="Enter email"/>
</div>
<div class="form-group">
<label for="exampleInputPassword1">Password</label>
<input type="password" class="form-control"
id="exampleInputPassword1" placeholder="Password"/>
</div>
<div class="checkbox">
<label>
<input type="checkbox"/> Check me out
</label>
</div>
<button type="submit" class="btn btn-default">Submit</button>
</form>
</div>
<!-- Modal Footer -->
<div class="modal-footer">
<button type="button" class="btn btn-default"
data-dismiss="modal">
Close
</button>
<button type="button" class="btn btn-primary">
Save changes
</button>
</div>
</div>
</div>
</div>
答案 1 :(得分:0)
<div class="modal fade" id="basicModal" tabindex="-1" role="dialog" aria-labelledby="basicModal" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title" id="myModalLabel">Modal title</h4>
</div>
<div class="modal-body">
<h3>Modal Body</h3>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Save changes</button>
</div>
</div>
会是这样的,但将其调整到你的班级