Get particular values in php from ajax serialize -
have input form input fields , selectors. want values input fields , selector values ajax pass php file , process in php file particular values
part of html this
<select name="record_date_selector[]" ... <input type="text" name="record_date[]" ...
ajax this
var values = $("form").serialize(); $.ajax({ type: 'post', url: '__popup-window_ajax.php', data: { 'clickedid' : $(this).closest('td').attr('id'), 'values' : values }, datatype: 'json', });
with php
echo json_encode($_post['values']);
get this
record_date_selector%5b%5d=3&record_date%5b%5d=02.07.2013
how can value of example record_date_selector
?
tried echo json_encode($_post['record_date_selector']);
way not correct
please advice
you can use in php file:
<?php // 'values' value , store array in $output parse_str($_post['values'],$output); // convert $output in json echo json_encode($output); ?>
and value ajax response this
response.your_input_name; //response.record_date_selector
Comments
Post a Comment