help me to insert data from array inputs from my table using ajax and php. I have the separate php file, but it is blank at the moment.
this is my current html + php code:
<form class='form-horizontal form-validate' id="form">
<?php
echo "<table id='example' class='table table-bordered'>
<thead>
<tr>
<th>Category</th>
<th>Last Qtr Average time</th>
<th>Target time</th>
</tr>
</thead>
<tfoot>
<tr>
<th>Category</th>
<th>last Qtr Average time</th>
<th>Target time</th>
</tr>
</tfoot>
<tbody>";
$get_category_query = "select * from daily_checklist_category order by category asc";
$get_category_result = mysql_query($get_category_query) or die(mysql_error());
while($count_rows = mysql_fetch_row($get_category_result)){
echo'<tr>';
echo'<td>'.$count_rows[1].'</td>';
echo'<td id="fucktime[]">'.$count_rows[2].'</td>';
echo'<td><input type="text" value="'.$count_rows[3].'" id="cat_rows[]"/></td>';
echo'</tr>';
}
echo "</tbody>
</table>";
?>
<div class="form-actions">
<input type="submit" id="finish" class="btn btn-primary" value="Submit">
</div>
and this is my ajax :
$(document).ready(function(){
$('#form').ajaxForm(function(){
//$("#loading").fadeIn();
var catRows = $('#cat_rows[]').val();
$.ajax({
type: "GET",
data: $('#form').serialize(),
url: 'pages/scripts/insert_daily_checklist_category.php',
cache: false,
success:function(data){
alert('Daily Checklist Categories are now updated.');
}
});
});
});
need help.