I have an html form that has a jquery ajax script to the form_handler.php. The php output echos a list of todo items plus date and person name.
Below is the php page. The data isn't persistent , I am just writing the ajax. What I want to do is to create a delete button for the task and add a checkbox to the ajax and delete button to the task and output to the response div.
So the output should be:
checkbox + task + delete button
Here is the php form:
if(isset($_POST['task_todo'])) {
$task = $_POST['task_todo'];
$name = $_POST['todo_name'];
$date = $_POST['due_date'];
echo $task;
echo $name;
echo $date;
die();
}
My Jquery is working to just output the 3 text fields but I only need one field plus I need to add the buttons. I don't know if I need JQuery UI for the buttons or to use my own buttons. Whatever works. I don't know how to edit the response to just get the task from the page and then add a checkbox and a delete button in jquery.
<script type-"text/javascript">
function submitForm() {
$.ajax({type:'POST', url: 'form_handler.php', data:$('#taskForm').serialize(),
success: function(response) {
$('#taskForm').find('.taskList').html(response);
}});
return false;
}