HOWEVER, the second form (Eval) is successful in all browsers. Does anyone know why the first script might not be successful in non-IE browsers? Is there something special about the way IE sends headers or about permission issues with cross-domain post requests?
//Begin CLE info submit button
$('#CLEinfoForm').submit(function(){
//validate and process form here
$('.error').hide(); //hide error labels
//load the form fields and make sure they are not empty
var name=$("input#theName").val();
if (name == ""){
//$("label#theName_error").show();
alert("Please enter your name!"); //$("input#theName").focus();
return false;
}
var barCheck=false;
<?php if($theBarNum) { ?>
var barNum=$("input#theBarNum").val();
barCheck=true;
if (barNum == ""){
//$("label#theBarNum_error").show();
alert("Please enter your Bar Number!"); //$("input#theBarNum").focus();
return false;
}
<?php } ?>
var email=$("input#theEmail").val();
var emailConfirm=$("input#theEmailConfirm").val();
var emailCheck=true;
if (email == null){
alert("Please enter an email address!");
emailCheck=false;
return false;
}
if (echeck(email)==false){
$("input#theEmail").val("");
$("input#theEmail").focus();
emailCheck=false;
return false;
}
if (email != emailConfirm){
//$("label#theEmail_error").show(); //show the error message if the emails don't match
alert("The email addresses you entered do not match!"); //$("input#theEmail").focus();
emailCheck=false;
return false;
}
var recordingCheck=$("input#recordingCheck:checked").val();
var readCheck=$("input#readCheck:checked").val();
if (recordingCheck == null){
//$("label#recordingCheck_error").show();
alert("Please verify that you have listened to the program!"); //$("input#recordingCheck").focus();
return false;
}
if (readCheck == null){
//$("label#readCheck_error").show();
alert("You must check the suggested readings box!"); //$("input#readCheck").focus();
return false;
}
var CLEdata = "theName=" + name + "&theEmail=" + email + "&theEmailConfirm=" + emailConfirm + "&recordingCheck=" + recordingCheck + "&readCheck=" + readCheck;
if (barCheck){
CLEdata+="&theBarNumber=" + barNum;
}
if (emailCheck && recordingCheck !== null && readCheck !== null){
//alert(CLEdata);return false;
$.ajax({
type: "POST",
url: <? echo "'".$postURL."'" ; ?>,
data: CLEdata,
cache: false,
success: function() {
return true;
//$("form").submit();
//$('#pageTitle').html("<h2>Process Completed</h2>");
//$('#CLEform').html("");
//$('.entry').html("<div id='message'></div>");
//$('#message').html("<p>Your submission was successful. You should receive a confirmation email shortly. Your Certificate of Attendance is being processed and will arrive via email. Make sure to print it out and then either file it with the relevant jurisdiction(s) or store it in your own records.</p>");
},
error: function (XMLHttpRequest, textStatus, errorThrown){
if(XMLHttpRequest.readyState == 0 || XMLHttpRequest.status == 0) {
return; // it's not really an error
}
else {
alert("There was a problem with your request" + '\n' + textStatus + "--" + XMLHttpRequest.responseText + "-" + XMLHttpRequest.status + "-" + errorThrown);
//$('label#readCheck_error').show();
//$('label#readCheck_error').html(XMLHttpRequest.status + "<br />" + textStatus + "<br />" + XMLHttpRequest.responseText);
}
}
});
return true;
}
return false;
});
//Begin Eval submit button
$('#submitEval').click(function(){
//validate and process form here
$('.error').hide(); //hide error labels
//load the form fields and make sure they are not empty
var Q1=$("input[@name='Q1']:checked").val();
if (Q1 == ""){
alert("Please answer question 1.");
return false;
}
var Q2=$("input[@name='Q2']:checked").val();
if (Q2 == ""){
alert("Please answer question 2.");
return false;
}
var Q3=$("input[@name='Q3']:checked").val();
if (Q3 == ""){
alert("Please answer question 3.");
return false;
}
var Q4=$("input[@name=Q4]:checked").val();
if (Q4 == ""){
alert("Please answer question 4.");
return false;
}
var Q5=$("textarea#evalQ5").val();
var evalData = "Q1=" + Q1 + "&Q2=" + Q2 + "&Q3=" + Q3 + "&Q4=" + Q4 + "&Q5=" + Q5;
var evalSub = false;
//alert(evalData); return true;
$.ajax({
type: "POST",
url: <? echo "'".$evalURL."'" ; ?>,
data: evalData,
success: function() {
$("form:first").submit();
//alert("success...");
evalSub = true;
return true;
},
error: function (XMLHttpRequest, textStatus, errorThrown){
alert("There is a problem with the evaluation form!");
return false;
//$('label#readCheck_error').show();
//$('label#readCheck_error').html(XMLHttpRequest.status + "<br />" + textStatus + "<br />" + XMLHttpRequest.responseText);
}
});
return true;
});