2012-11-08 4 views
-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> 

+0

여기에 내가 볼 수없는 질문이 있습니까? –

+0

예 : 제출 버튼을 클릭하면 맞춤 알림 상자를 열려고합니다 ... 브라우저 기본 경고 상자를 바꿉니다. – user1810371

답변

0

대체 ... 당신이 jquery 포함 한 가정 및 경고 당신이에 링크 된 사이트에서 다운로드 (JS 및 CSS) 플러그인 alert('etc etc')

jAlert('your message here')