-1

我尝试使用 html 表格进行一项考试,该表格会找到不正确的答案,并会使用警告框写出正确的答案。但我想使用另一个自定义警报框。

当我单击提交按钮时,我想打开自定义警报框。

使用此警报框http://www.abeautifulsite.net/blog/2008/12/jquery-alert-dialogs/

谢谢 !!!谢谢 !!!


这是代码。

<SCRIPT Language ="JavaScript">

function ValidateForm(){
result = new Array();
count = 0;

if (!document.forms[0].one[1].checked == true) {
result[count] = "Question 1.  Correct answer is " + document.forms[0].one[1].value + ".";
count++;
}

if (!document.forms[0].two[1].checked == true) {
result[count] = "Question 2. correct answer is" + document.forms[0].two[1].value + ".";
count++;
}

if (!document.forms[0].three[0].checked == true) {
result[count] = "Question 3. The correct answer is " + document.forms[0].three[0].value + ".";
count++;
}

if (!document.forms[0].four[2].checked == true) {
result[count] = "Question 4. The correct answer is " + document.forms[0].four[2].value + ".";
count++;
}

if (result.length > 0) {
var vString = "";
for (var i=0; i<result.length; i++) {
vString = vString + result[i] + "\n";
}

alert(result.length + " incorrect answer:\n" + vString);
return(false);
}

else {
alert("All of the questions were answered correctly so submit email notice.");
return(true);
}
}

</SCRIPT>

4

1 回答 1

0

假设您已包含jquery和您从链接到的站点下载的警报插件(js 和 css)...

代替 alert('etc etc')

jAlert('your message here')

于 2012-11-08T20:50:31.400 回答