按钮可以正确提交,但是<a>的连接怎么都提交不了,何解?
$(function() {
$('#submit').button().click(function() {
$('#action').val('add');
$('#commentform').submit();
});
$('a#comment-delete').click(function(){
$('#action').val('delete');
$('#key').val($(this).attr('title'));
$('#commentform').submit();
});
});
<a id="comment-delete" href="#" title="9">Delete</a>
<form action="/comment" method="post" id="commentform">
<input type="hidden" name="action" id="action"/>
<input type="hidden" name="key" id="key"/>
。。。。
<button id="submit">Submit Comment</button>
</form>
--
修改:neek2000 FROM 221.223.85.*
FROM 221.223.85.*