// calling script var ddt; for(i=0;i<full_id_array.length;i++) { if(full_ck_array[i]=='yes') { idname=full_id_array[i]; ddt += primary_general(idname); // called java script alert(ddt); } } alert('final...'+ddt);
function primary_general(k) { var idname=k, xyz = "#"+idname, xverified='0'; var y = $(xyz).val(); $.ajax( { type: "POST", url: checkingfilename, data: {async: false, pass_type_array: tparray, pass_error_array: erarray, pass_element_array: idarray, pass_element_maxlength: 0, pass_element_id: k, pass_element_value: y, pass_operation: 'ind',}, success: function(data) { var cidnm = $.parseJSON(data); $(cidnm.error_id).html(cidnm.error_mess); if(cidnm.error_mess != '') { xverified = '1'; } return xverified; }, error: function(data) { xverified = '1'; return xverified; } }); }