作业提交时,根据验证结果相应空间focus

This commit is contained in:
sw 2015-06-05 16:57:09 +08:00
parent f675211642
commit 79893c4917
1 changed files with 9 additions and 1 deletions

View File

@ -470,7 +470,15 @@ $(function(){
//老师提交 新建/修改 作业 //老师提交 新建/修改 作业
function submit_homework(id) function submit_homework(id)
{ {
if(regex_homework_name()&&regex_evaluation_num()) if(!regex_homework_name())
{
$("#homework_name").focus();
}
else if(!regex_evaluation_num())
{
$("#evaluation_num").focus();
}
else
{ {
homework_description_editor.sync(); homework_description_editor.sync();
$("#"+id).submit(); $("#"+id).submit();