function FillData() {
var param = $("#<%= TextBox1.ClientID %>").val();
$("#tbDetails").append("<img src='Images/loading.gif'/>");
$.ajax({
type: "POST",/*method type*/
contentType: "application/json; charset=utf-8",
url: "Default.aspx/BindDatatable",/*Target function that will be return result*/
data: '{"data":"' + param + '"}',/*parameter pass data is parameter name param is value */
dataType: "json",
success: function(data) {
alert("Success");
}
},
error: function(result) {
alert("Error");
}
});
}
$(document).ready(function(){
// submit button click
$("#submit").click(function(){
var name = $("#txt_name").val();
var email = $("#txt_email").val();
var lang = [];
// Initializing array with Checkbox checked values
$("input[name='prolang']:checked").each(function(){
lang.push(this.value);
});
if(email != ''){
$.ajax({
url: 'getData.php',
type: 'post',
data: {name:name,email:email,lang:lang},
dataType: 'JSON',
success: function(response){
$('.details').show();
// selecting values from response Object
var name = response.name;
var email = response.email;
var lang = response.lang;
var foundjquery = response.foundjquery;
// setting values
$('#name').text(name);
$('#email').text(email);
$('#lang').text(lang);
$('#foundjquery').text(foundjquery);
}
});
}
});
});