1
我有一個非常基本的表單,如果表單有效後單擊提交按鈕,然後顯示操作頁面,我想要顯示一個加載圖像。這裏是驗證的JavaScript代碼:當表單有效時單擊提交按鈕後顯示加載圖像
<script type="text/javascript">
function validateForm()
{
valid = true;
if(document.grades.fullName.value == "")
{
alert ("Please fill out your Full Name.");
valid = false;
}
if(document.grades.idNo.value == "")
{
alert ("Please fill out your ID Number.");
valid = false;
}
if(document.grades.pCS.value == "")
{
alert ("Please fill out your grade for Prelim Class Standing.");
valid = false;
}
if(document.grades.pExam.value == "")
{
alert ("Please fill out your grade for Prelim Examination.");
valid = false;
}
if(document.grades.mCS.value == "")
{
alert ("Please fill out your grade for Midterm Class Standing.");
valid = false;
}
if (document.grades.mExam.value == "")
{
alert ("Please fill out your grade for Midterm Examination.");
valid = false;
}
if(document.grades.fCS.value == "")
{
alert ("Please fill out your grade for Finals Class Standing.");
valid = false;
}
if(document.grades.fExam.value == "")
{
alert ("Please fill out your grade for Finals Examination.");
valid = false;
}
return valid;
}
</script>
請別人告訴我有多完全。
「請有人告訴我如何徹底。」對不起,這是不是租編碼器 – 2013-08-05 01:34:18
也許這種邏輯可能會幫助你在這裏 - [加載圖像一旦文件提交點擊](http://stackoverflow.com/questions/1715959/loading-image-once-file-submit-clicked ) – woofmeow
請向我們展示您嘗試過的代碼。 – tb11