I have three tables in which one is used to add data to the two tables and in the upper table I would like
when I choose select_multiple or select one the second table with choice_name, choice_list and choice label table to pop up
when I choose the remaining in the field of type the data should continuos fill data with id
<html>
<div class="modal fade"id="choicesModal"role="dialog">
<div class="modal-dialog">
<div class="container-fluid xheight">
<div class="row">
<table class="table table-bordered table-striped table-highlight" id="tblTypes">
<thead>
<tr>
<th>Type*</th>
<th>Name*</th>
<th>Label*</th>
<th>Unit*</th>
<th style="display: none;"Category*></th>
<th>List_name*</th>
<th>choice_name*</th>
<th>choice_label*</th>
<th> </th>
</tr>
</thead>
<tbody>
<form id="variable" action="#">
<input type="text" id="id" name="id" class="form-control hidden"/>
<input type="text" id="sop_id" name="sop_id" class="form-control hidden" value="<?=$sop_id?>"/>
<tr>
<td>
<select id="type" name="type" class="form-control">
<option></option>
<option>integer</option>
<option>decimal</option>
<option>select_one</option>
<option>select_multiple</option>
<option>barcode</option>
<option>image</option>
<option>video</option>
<option>date</option>
<option>string</option>
<option>geo_point</option>
<option>note</option>
</select>
</td>
<td>
<input type="text" id="name" name="name" class="form-control" value=""/>
</td>
<td>
<input type="text" id="label" name="label" class="form-control" value=""/>
</td>
<td>
<div class="modal-body">
<form role="form">
<div class="form-group">
<input type="text" id="list_name" name="list" class="form-control" value=""/>
</div>
</td>
<td>
<div class="form-group">
<input type="text" id="choice_name" name="variable" class="form-control" value=""/>
</div>
</td>
<td>
<div class="form-group">
<input type="text" id="choice_list" name="choice" class="form-control" value=""/>
</div>
</td>
<td>
<button type="button" id="addRec" class="btn btn-secondary btn-block"
onclick="addVariable()">Add
</button>
<button type="button" id="entry-update-btn" class="btn btn-sm btn-primary btn-block">Update</button>
<button type="button" id="entry-update-cancel-btn" class="btn btn-sm btn-warning btn-block">Cancel</button>
</td>
</tr>
</form>
</tbody>
</table>
</div>
<div class="row">
<table class="table table-bordered table-striped" id="survey">
<thead>
<th>Type*</th>
<th>Name*</th>
<th>Label*</th>
<th>Unit*</th>
</thead>
<tbody>
<tr data-entry-id="survey">
<td class="type"></td>
<td class="name"></td>
<td class="label"></td>
<td class="unit"></td>
</tr>
</tbody>
</table>
</div>
<div class="row">
<div class='modal-body'>
<div class="modal-header"style=padding:35px 50px;>
<div class=
<table class="table table-bordered table-striped" id="choices">
<thead>
<th>List_name*</th>
<th>choice_name*</th>
<th>choice_label*</th>
</thead>
<tbody>
<tr data-entry-id="choices">
<td class="list_name"></td>
<td class="choice_name"></td>
<td class="choice_label"></td>
</tr>
</tbody>
</table>
</div>
</html>