Hi,
The following code contains tabs linked to php pages. Each one of those tab is independant from each other and I would like to save each information independanltly.
I meet the following problem : My Form variables are empty when I check the values in the ajax call.
Can someone help me solving this problem ?
Here is the code
<link rel="stylesheet" href="css/jquery-ui.css">
<script src="js/jquery-1.12.4.js"></script>
<script src="js/jquery-ui.js"></script>
<?php include 'utils.php'; ?>
<form method="POST" action="tabs.php" id="pm2form">
<div id="onglets" >
<ul>
<li><a href="#onglet-1">Project Info</a></li>
<li><a href="#onglet-2">Dashboard</a></li>
<li><a href="#onglet-3">Scope</a></li>
<li><a href="#onglet-4">Time</a></li>
<li><a href="#onglet-5">Cost</a></li>
<li><a href="#onglet-6">Tolerances</a></li>
<li><a href="#onglet-7">Project Data</a></li>
</ul>
<div id="onglet-1" class="onglet">
<?php if (isset($_GET["project_id"])) {$project_id = $_GET["project_id"];}
include('projectinfo.php'); ?>
</div>
<div id="onglet-2" class="onglet" >
<?php include('dashboard.php'); ?>
</div>
<div id="onglet-3">
<?php include('scope.php'); ?>
</div>
<div id="onglet-4">
<?php include('time.php'); ?>
</div>
<div id="onglet-5">
<?php include('cost.php'); ?>
</div>
<div id="onglet-6">
<?php include('tolerances.php'); ?>
</div>
<div id="onglet-7">
<?php include('projectData.php'); ?>
</div>
</div>
<?php include('footer.php'); ?>
<script>
$(function() {
var tabs = $('#onglets').tabs();
$("#pm2form").submit(function(e) {
e.preventDefault();
var donnees = $(this).serialize();
$.ajax({
url:'saveFormData.php',
type:'POST',
dataType : 'json',
data : donnees,
success : function(data, statut){
jQuery.each(data, function(index, item) {
alert ("index"+index+"item"+item);
});
},
error : function(resultat, statut, erreur){
alert ("resultat "+resultat+" statut "+statut+" erreur "+erreur);
},
complete : function(resultat, statut){
}
});
});
});
</script>
</form>
I have rename my php files in text files in order to be able to attach them on this post.
Regards.
Benoit