Hello

I have a number of textboxes in a "new Array" which contain the answers of the quiz. There is a button "show answers" that neatly puts the answers in the textboxes, using the "function show" below. However, I would like the user to attempt all fields before they peek at the answers. I know the temptation will be too great to resist, so I want to put in an alert " complete all fields" on the "function show" to complete all fields before accessing the answers.


function show(){
for(i=0;i<answer.length;i++){
document.myform.elements[i].value = answer[i];
}
}


//My attempt was this, but didn't work

function show(){
for(i=0;i<answer.length;i++){
if(document.myform.length.value!=""){
alert("Please complete all fields");
return false;
}else
if(document.myform.elements[i].value = answer[i]){
}
}
}


I thought I was close but something is seriously missing, could you please give me a hand. Thanks

Ants