I am trying to use “form:has” selector which works on Chrome but not on IE.
Does anyone have any idea why it is not working on IE? (when pushing the Post button there should be an alert box)
Edited:
Here is the code:
JS:
$(document).ready(function() {
$(".comment-link").live('click',function() {
return false;
});
$("#morefeeds-link").click(function () {
return false;
});
// Form submittion - doesnt work
$("form:has(.commentBtn)").live('submit',function () {
alert("a");
return false;
});
return false;
});
HTML
<form>
<a href="#" class="comment-link" style="font-size:12px;">Comment</a>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td valign="middle">
<input type="hidden" name="commentkey" value="1">
<input type="text" name="commenttext" class="commentfocus" value="Express your opinion">
</td>
<td valign="middle"><input type="submit" class="commentBtn" value="Post"></td>
</tr>
</table>
</form>
Live submit is broken in IE if you register a live click event earlier.
See http://dev.jquery.com/ticket/6359 for a bug report and a hack to circumvent the issue.
There’s also a discussion about it in the jquery forums: http://forum.jquery.com/topic/ie-specific-issues-with-live-submit