I have a list of check boxes and on click event of a button i am passing the vlaue of the clicked chk box to a php file, and in that php file i am retrieving some text data from mysql db and returns to the jquery fileand displays that text data in a text area. But the control is not going to the php file, but its coming to the jquery file. I am very new to wordpress. so i dnt kow what to do and anything need to be done.
Pls find my code below.
jQuery( document ).ready( function( $ ) {
$("#save_value").on('click',function(){
var val = [];
$("input:checked").each(function(i){
val[i] = $(this).val();
});
alert(val);
$.ajax({
type:'POST',
url: "<?php bloginfo('url') ?>./getData.php",
success: function(data) {
// $('#result').html(data);
alert(data);
}
});
});
});
and my php file is
<?php
echo 'hi';
$output = "returned data from ";
echo $output;
?>
my php file is in theme folde and jquery file is in js folder under theme folder.
Can anybody pls help me to find out a solution.
Thanks Priya
"<?php bloginfo('url') ?>./getData.php",?.in your url variable?alert(val);this is alerting..?