Below are the script that I use on my website to send instant messages. It works fine in 99,9% of cases, but from time to time some user reports that he/she can't send messages. Today I received a new report from MIE 8.0 user. I checked server's logfiles and discovered that this script is being ignored by MIE 8.0. When user clicks "Send" button, instead of POST request, browser sends GET request with all form data to the same file where the form is located. This user says that a few days ago everything was working fine. I didn't change anything in my files and I don't think that this user a few days ago upgraded MIE to 8.0 (the most recent version is 9.0). I have this problem more than 3 years. There are not so many users who have reported this problem but anyway I want to find a solution. Is it possible that the script doesn't work because is located inside of instead of ?
Any ideas what may cause this problem? Thanks.
<script type="text/javascript">
$(document).ready(function(){
$("#sendmessage").submit(function(){
$("#note1").show().html('<div style="text-align: center;">Sending</div>');
var str = $(this).serialize();
$.ajax({
type: "POST",
url: "/messages.php?do=send",
data: str,
success: function(data) {
if (data == "ERR1") {
result = '<div class="red">Error1 1</div>';
$(this).html(result);
}
else if (data == "ERR2") {
result = '<div class="red">Error2</div>';
}
else {
$("#fields").hide();
result = data;
}
$('#note1').hide();
$("#note").hide();
$("#note").fadeIn(1000).html(result);
}
});
return false;
});
});
</script>
<form id="sendmessage" name="sendmessage" onsubmit="doCheck();">
...
<textarea></textarea>
...
<input type="submit" value="Send" onclick="doCheck();" />
</form>