I don't know why your specified a callback for the fadeIn, it doesn't appear to do anything. If you change success to the following, what happens ?
success: function() {
$('#weekly_poll').html("<div id='message'></div>");
$('#message').html("<h2>Thanks for your vote!</h2>").hide().fadeIn(500);
}
pritaeas
Posting Expert
5,445 posts since Jul 2006
Reputation Points: 653
Solved Threads: 872
It's hard for me to test, without having the complete code (html and php), I can only guess at this point, because the code looks okay.
pritaeas
Posting Expert
5,445 posts since Jul 2006
Reputation Points: 653
Solved Threads: 872
I uploaded this to my server (saved it as index.php). Appears to be working in IE7 and IE8. Can you confirm ?
<div style="background-image: url(../images/poll_background_mid.gif); background-repeat: repeat-y; width: 510px;">
<div id="weekly_poll" style="padding: 5 0 0 20;">
<form name="poll" action="">
<label for="name" id="name_label">Question 1? </font>
<input type="hidden" name="userid" id="userid" value="<?php echo $userid; ?>"/>
<div style="margin: 5 0 0 0;">
<input type="radio" name="name" id="name" value="Yes" /> Yes
</div>
<div style="margin: 0 0 5 0;">
<input type="radio" name="name" id="name" value="No" /> No
</div>
<input type="submit" name="submit" class="button" id="submit_btn" value="Vote" />
</form>
</div>
</div>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script>
$(function() {
$('.error').hide();
$(".button").click(function() {
var userid = $("input#userid").val();
var name = $('input[name=name]:checked').val();
var dataString = 'name='+ name + '&userid=' + userid;
alert(dataString);
$.ajax({
type: "POST",
url: "process.php",
data: dataString,
success: function() {
$('#weekly_poll').html("<div id='message'></div>");
$('#message').html("<h2>Thanks for your vote!</h2>").hide().fadeIn(500);
}
});
return false;
});
});
</script>
pritaeas
Posting Expert
5,445 posts since Jul 2006
Reputation Points: 653
Solved Threads: 872
pritaeas
Posting Expert
5,445 posts since Jul 2006
Reputation Points: 653
Solved Threads: 872
I see, opera has the same problem, although I cannot explain it at this moment. I'll keep looking.
pritaeas
Posting Expert
5,445 posts since Jul 2006
Reputation Points: 653
Solved Threads: 872
Damn... missed it completely. Your <label> tag isn't correctly closed. It is closed with </font> . Replaced it with </label> and now it works in Opera and IETester.
pritaeas
Posting Expert
5,445 posts since Jul 2006
Reputation Points: 653
Solved Threads: 872
I think you need to add another ajax call to a php page that will return the result in html, so you can add it to a div.
pritaeas
Posting Expert
5,445 posts since Jul 2006
Reputation Points: 653
Solved Threads: 872