I have one from through which I am entering project name and sheet name which will be saved in project table. Based on this I am inserting empty values on another table 'Data'. I am using editable table to update these empty values in database. I want to hide this table till project name and sheet name is submitted and once value is submitted then only table will be displayed. I have tried a lot but after clicking submit button my table gets displayed till page is reloaded and disappers when loading is completed. My code parts are like below.
<script>
$(function(){
$('button#showit').on('click',function(){
$('#myform').show();
});
});
</script>
<form class="form-horizontal" action="db.php" id="#form1"
onSubmit="function();" method="post">
<input type="text" class="form-control1" name="projectname"
id="projectname" required >
<input type="text" class="form-control1" name="sheetname" id="sheetname"
required >
<button type="submit" name="submit" id="button" class="btn-
success btn" >Submit</button>
</form>
<div class="tab-content" id="myform" style="display:none">
<div class="tab-pane active" id="horizontal-form">
<?php
$s4 = "SELECT * FROM data ORDER BY data_id DESC LIMIT 1";
$res = mysqli_query($bd, $s4);
while ($row = mysqli_fetch_array($res))
{
?>
<table class="table table-bordered" style="width:50%;">
<thead>
<tr>
<th>Sr.no</th>
<th>Column Name</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>1</td>
<td id="d1:<?php echo $row['data_id']; ?>" contenteditable="true"><?php
echo $row['d1']; ?></td>
</tr>
.
.
.
</tbody>
</table>
<?php } ?>
</div>
</div>
on db.php I have used to get back on my previous page
<script>
alert('Sheet Created Successfully');
window.location.href='index.php?success';
</script>