I have a simple Jquery function here:
function submit_selection(del,submit)
{
del='yes';
submit=true;
var ITAMZ=new Array();
var count=0;
if (submit)
$('input[group="Blaaa"]:checked').each (function(){
ITAMZ[count]=$(this).attr('name');
count+=1;
});
$('#s_o_s_r').html('Submitting...');
$.ajax({
url: "script/order_select_submit.php",
context: document.body,
success: function(data){
$('#s_o_s_r').html(data);
},
error: function()
{
$('#s_o_s_r').html('error submitting');
},
async:true,
type: "POST",
data: {'ITAMZ' : ITAMZ, 'delete': del},
dataType: "html"
});
}
I swear God, if I trigger it from a href like this:
$('#remove_sel').click(function(){
submit_selection('yes',true);
});
It always returns an error, but if I trigger it from a button like this:
$('input.client_btn').click(function(){
var shiiit=$(this).attr('name');
if (shiiit=='all') document.location.href="order_price.php?show=all";
else if (shiiit=='selected') {
///document.location.href="order_price.php?show=selected";
submit_selection('yes',true);
}
else document.location.href="order_price.php";
});
It always triggers a success.
This is rediculous, and I just don’t get it.
Plase help… Q.&
I abandoned a href, and used a SPAN. It was problem with javascript void(0)