You want to prevent the form from submitting on special conditions?
If so, you should first probably avoid using click and rather use the submit event which supports keyboard actions. After changing the event to submit, you can use event.preventDefault() which prevents the form submit.
So your code should probably look like this (note: untested):
$('<your form selector>').bind('submit', function(event) {
$('#PricingEditExceptions input[name=PMchk]').each(function() {
if ($("#PricingEditExceptions input:checkbox:checked").length > 0) {
var checked = $('#PricingEditExceptions input[type=checkbox]:checked');
var PMstrIDs = checked.map(function() {
return $(this).val();
}).get().join(',');
$('#1_exceptiontypes').attr('value', exceptiontypes)
$('#1_PMstrIDs').attr('value', PMstrIDs);
} else {
alert("Please select atleast one exception");
event.preventDefault(); // Stop the submit here!
}
});
});
More info here: .bind() jQuery API (it's quite far down the page, so do an in-page search for .bind("submit"). More here as well: .submit() and .preventDefault()