我有一个反馈表单,由jquery验证,请求使用ajax发送到Php页面。因此,在firebug中,我检查了它是否成功显示&#34;成功消息&#34; ,但为什么它没有显示在hmtl页面<div id="#feedback_result"></div>
标记中?< / p>
Jquery代码:
<script>
$(document).ready(function() {
// validate signup form on keyup and submit
$("#feedback").validate({
submitHandler: function(form) {
$.ajax({
url: form.action,
type: form.method,
//async: false,
data: $(form).serialize(),
beforeSend : function (){
$('input[type=submit]').attr('disabled', false);
},
success: function(response) {
$('#feedback_result').html(response);
}
});
},
rules: {
yourfeedback: "required",
},
messages: {
yourfeedback: "Required",
}
});
});
</script>
Html代码:
<div id="#feedback_result"></div>
<form id="feedback" method="post" action="<?php echo htmlspecialchars("feedback_process.php"); ?>">
<table width="400" border="0" cellspacing="5" cellpadding="0">
<tr>
<td>Your feedback</td>
</tr>
<tr>
<td><textarea class="textarea2" name="yourfeedback" placeholder="Your feedback"></textarea></td>
</tr>
<tr>
<td><input type="submit" id="submit" value="Send Feedback" name="submit" class="submit_button"/></td>
</tr>
</table>
</form>
</div>
注意:除了ID $("#order").validate({
答案 0 :(得分:3)
尝试从#
值中删除id
:
<div id="feedback_result"></div>