When one or fewer checkboxes are selected and you click the Compare tours button, a popup should appear. However, this functionality is ONLY working in Chrome. What can I do to make it work in Firefox and IE?
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder" runat="Server">
<script type="text/javascript">
$(document).ready(function () {
var selectedCheckboxes = $("input:checkbox[id$=Select]");
$("[id*=CompareTop]").click(function() {
if (selectedCheckboxes.filter(":checked").length <= 1) {
event.preventDefault();
alert("Please select at least 2 tours to compare.");}
});
selectedCheckboxes.change(function() {
if (selectedCheckboxes.filter(":checked").length > 3){
$(this).removeAttr("checked");
alert("At most 3 tours may be compared.");
}
});
});
</script>
<sc:Placeholder ID="phHeader" Key="ph_header" runat="server" />
Your function should take an argument called “event”, no? The fact that it does not is certainly why it doesn’t work in Firefox.