"Panel for Add-Legs snippet"
Bootstrap 3.1.0 Snippet by jfenn

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<link href="//netdna.bootstrapcdn.com/bootstrap/3.1.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.0/js/bootstrap.min.js"></script>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
<div class="container">
<div class="row">
<div class="panel panel-primary">
<div class="panel-heading">
<div class="panel-title">
Add Legs to Flight
</div>
</div>
<div class="panel-body">
<div class="row clearfix">
<div class="col-md-12 column">
<table class="table table-bordered table-hover" id="tab_logic">
<thead>
<tr >
<th>
Leg
</th>
<th>
Origin
</th>
<th>
Planned Departure Time
</th>
<th>
Actual Departure Time
</th>
<th>
Destination
</th>
<th>Planned Arrival Time</th>
<th>Actual Arrival Time</th>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
$(document).ready(function(){
var i=1;
$("#add_row").click(function(){
$('#addr'+i).html("<td>"+ (i+1) +"</td><td><input name='origin"+i+"' type='text' placeholder='Name' class='form-control input-md' /> </td><td><input name='est_departure"+i+"' type='text' placeholder='Mail' class='form-control input-md'></td><td><input name='act_departure"+i+"' type='text' class='form-control input-md'></td><td><input name='destination"+i+"' type='text' class='form-control input-md'></td><td><input name='est_arrival"+i+"' type='text' class='form-control input-md'/></td><td><input name='act_arrival"+i+"' type='text' class='form-control input-md' /></td><td><input name='aircraft"+i+"' type='text' class='form-control input-md' /></td>");
$('#tab_logic').append('<tr id="addr'+(i+1)+'"></tr>');
i++;
});
$("#delete_row").click(function(){
if(i>1){
$("#addr"+(i-1)).html('');
i--;
}
});
});
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Related: See More


Questions / Comments: