This seems like it should be a simple answer if you know Jquery AJAX. This script works but it returns the response of the query string of 3 xhr fields sent. Instead of the query string response pair results returned from response I just want value 1. {task_todo:value1, task_person:value2, due_date: value3}.
This script returns all 3 values
function submitForm() {
$.ajax({type:'POST', url: 'form_handler.php',
data:$('#taskForm').serialize(),
success: function(response) {
var qs = response;
$('#taskForm').find('.taskList').html(response);
}});
return false;
}
I tried to figure out how to parse out the response query string value below by adding the expressions below but couldn't get the first
value. Could you tell me what I'm doing wrong? THANKS. :confused
var task_todo= $.query(qs)['task_todo'];
alert(task_todo);
alert(qs[0].split)"=")[1]);