here is the BUTTON from the index.php to open the Modal form;
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<a href="#myModal" data-toggle="modal" value="#01" name="btn" class="button2 btn btn-success model_open" data-btnval = "#01" aria-hidden="true" data-dismiss="modal" >form</a>
this is the script to get the value of the current button;
$(document).on("click", ".model_open", function () {
var btnval = $(this).data('btnval');
$(".modal-body #btnval").text( btnval );
$('#hiddenid').val(btnval );
});
and this is the Modal Form echoing the button value "#01"
<!-- Modal header starts -->
<div aria-hidden="true" aria-labelledby="myModalLabel" role="dialog" tabindex="-1" id="myModal" class="modal fade">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header1" style="padding:10px 15px;">
<button type="button" class="close" data-dismiss="modal" >×</button>
<h4><span class="glyphicon glyphicon-pencil"></span>MODAL FORM</h4>
</div>
<div class="modal-body" style="padding:10px 10px;">
<!-- Modal header ends -->
<div id="btnval"></div> <!-- Echo the button value "#01" -->
<!-- Modal Application form starts -->
<div class="modal-body">
<div class="modal-body">
<form action="confirmation.php" method="get" enctype="multipart/form-data">
<!-- First Name Filed Starts -->
<div class="col-sm-6">
<div class="form-group">
<label for="name">NAME</label>
<input type="text" class="form-control" name="name" id="name" required="required" placeholder="Name">
</div>
</div>
<input type="submit" class="btn btn-success pull-right" value="NEXT">
when click NEXT button in the Modal Form, it will proceed to the 2nd page to dsiplay all of the information from Modal form together with the button value "#01";
<form id="main-contact-form1" style="background-color: #f0f8ff; padding: 20px;" class="contact-form1" name="contact-form1" method="post" action="sendappli.php" role="form">
<div class="label-field-pair">
<label>ID</label>
<input class="form-control" id='id' name='id' value='<?php echo $_GET["btnval"]; ?>' />
</div>
<div class="label-field-pair">
<label>Name</label>
<input class="form-control" id='name' name='name' value='<?php echo $_GET["name"]; ?>' />
</div>
checking the provided information before it will send to my email address.
problem: I can't get the value of "btnval" from <div id="btnval">
that need to have a NAME to get its value and echoing it to <?php echo $GET[posible name of btnval];?/>
at the 2nd page????