このコードをフォームの検証に使用していますが、
$("#btnaddregistration").live("click", function(e) {
e.preventDefault();
var errorCount = 0;
$("#formaddregistration").find("input").each(function(i) {
if ($(this).val().length == 0) {
errorfield = $(this);
errorCount++;
$("#modaldialogtext").text("'" + $(this).parent().parent().find("label").text() + "' cannot be left blank.");
$("#modal_confirmation").dialog("open");
return false;
}
});
if (errorCount > 0) {
return false;
} else {
document.forms["formaddregistration"].submit();
}
});
しかし、フォームは送信されていません。可能なすべての送信方法を使用しましたが、失敗しました。私が間違っているところはありますか?