I am trying to create a table that would change its content based on user input. The table displays some data from a database; it starts the selection starting with a given calendar date that defaults to current date. I took a look at jQuery - Reload table. Then I made a PHP script that generates the table, gentable.php. When I try using a button with the event:
$(document).ready(function(){
$("#maket").click(function(){
$("#mytable").load("tablegen.php");
});
});
everithing goes fine(the div mytable is filled with the generated table). Now I want to send some input data to the PHP script in order to generate the table starting with a different date. This is what I tried:
$(document).ready(function() {
$('#myform').ajaxForm({
target: '#mytable',
success: function() {
$("#mytable").load("tablegen.php");
}
});
});
Ve PHP script aşağıdaki satırları ekledi:
if (isset($_POST['textf'])){
$value = $_POST['textf'];
}else{
$value = '2010/11/28';
}
genTable($value);
Unfortunatelly, this opens a new page that contains the table with beginning date not modified. What am I doing wrong? I also tried using .post but had no successful results. Please help. Thanks a lot. Diana