Hello all,
I made a button on the edit page its called "Order Flowers", this button is calling a function check_fields(); I wrote this function on the JS onLoad Events page, function is below. the problem is that I am getting an error "check_fields is not defined" I already check and it is include on the js events page. looking through the source of the page it seems like the events page is include at the bottom of the page is this correct? if it is then is there a way to fix this? so that i won't get undefined.. thanks.
function check_fields(){
if(floresm.getValue() == "")
{ alert("Flowers Message Can Not Be Blank");
floresm.style.backgroundColor='red';
floresm.focus();
return false;}else{floresm.style.backgroundColor='white';}
if(florest.getValue() == "")
{ alert("Flowers Type Can Not Be Blank");
florest.style.backgroundColor='red';
flroest.focus();
return false;}else{florest.style.backgroundColor='white';}
if(florescom.getValue() =="")
{ alert("Company Can Not Be Blank");
florescom.style.backgroundColor='red';
florescom.focus();
return false;}else{florescom.style.backgroundColor='white';}
if(vdate == "" || vdate == "0000-00-00")
{ alert("Please wait until viewing is reserved");
return false;}
if(florest.getValue() != '' && floresm.getValue() != '' && florescom.getValue() != '' && vdate != '0000-00-00'){
$("input[type='button'][name='send_email']").click(function(e){
$.ajax({
type: "GET",
url: "include/orders.php",
data: "case_id="+$(this).attr('case_id')+"&order_type="+$(this).attr('order_type')+"&company="+$(this).attr('company'),
success: function(msg){
alert("Order Sent.");
}
})
$(this).attr("disabled","disabeld");
$(this).attr("value","Order Sent");
});
}
}