I'm having a issue trying to get this worked out,not sure how best to execute it.
I Have a Page that opens a Modal on load, and has a Dynamic selection inside of it based on a MySQL data pull. What I want is that when hitting the Selection button that it will read the input selected in the Modal and set a variable I can use with the rest of the Page.
The Code for my modal is
<div class="modal fade" id="CompanySelect" tabindex="-1" role="dialog" aria-labelledby="ModalCenterTitle" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content regmodel">
<div class="modal-header">
<h2 class="modal-title" id="ModalTitle" style="margin:auto;">Select Company</h2>
</div>
<div class="modal-body">
<form class="CompanySelection">
<div class="selector">
<?php
while($row = mysqli_fetch_array($CompaniesResults)) {
$x = $x + 1;
$Comp_array = array($row['Company_ID'], $row['Company_Name'], $row['WebID'], $row['Logo']);
?>
<input id="<?php ECHO $Comp_array[2];?>" type="radio" name="Company" value="<?php ECHO $Comp_array[0];?>" required/>
<label class="Compselect <?php ECHO $Comp_array[2];?>" for="<?php ECHO $Comp_array[2];?>"></label>
<?php } ?>
</div>
</form>
</div>
<button type="button" class="btn btn-primary regbtn" data-dismiss="modal">Select</button>
</div>
</div>
</div>
<script type="text/javascript">
$(window).on('load',function(){
$('#CompanySelect').modal('show');
});
$('#CompanySelect').modal({
backdrop: 'static',
keyboard: false
})
</script>
Basically it will then Set Variable $CompSel = that I can use with the rest of the page without issues. This being a selection of various fields and some text fields that will eventually be saved to the database again using the $CompSel Made from the Modal as well.
Thanks for the Assist ahead of time.