I need to do this through jQuery-ajax without reloading the page. But I can’t even get the click function to work. The code looks like this..
$("#add").click(function(){
var selval = $('#cat').val();
alert('ok');
$.ajax({
type:"POST",
url:"main_end.php",
data:"categ="+selval,
success:function(response){
$('#results').html("test");
}
});
return false;
});
Add error tag as shown below and make sure you are not getting any error here :