以下のエラーメッセージは、強調表示されたフィールドで完全に機能しています。今を除いて、異なる機能を必要とする力。現在、エラーメッセージは赤い境界線でフィールドを強調表示し、フォーカスを合わせると境界線が削除されます。ただし、ユーザーが送信を押すまで赤の強調表示を維持する必要がある権限onclick="return formSubmit()"
.submit関数を使用してみました(バインド解除を削除し、.focus関数からフォーカスを削除しましたが、赤い強調表示は関係なく持続します。
<!--Jquery function to override JS alert with DOM layer alert message-->
function customAlert(inputID,msg){
var div = $(".errorPopup");
div.css({"display":"block"});
$("#"+inputID).addClass("CO_form_alert").parent().addClass("alertRed");
if (div.length == 0) {
div = $("<div class='errorPopup' onclick='$(this).hide();'></div>");
$("body").prepend(div);
}
div.html(msg);
$("#"+inputID).focus(function(){
$(this).unbind('focus'); // remove this handler
$(this).removeClass("CO_form_alert")
.parent().removeClass("alertRed"); // undo changes
$('.errorPopup').hide(); // hide error popup
});
}