while内のifステートメントを関数でループしようとしています。ただし、最初のifステートメントにのみヒットし、ループを停止します。
サンプル:
while(No.length == 0 || Name.length == 0 || Tel.length == 0
|| Date.length == 0 || Email.length == 0) {
alert("Don't leave blank!");
if (No.length == 0) {
document.getElementById('Nos').style.visibility = 'visible';
return false;
}
if(Name.length == 0) {
document.getElementById('Name').style.visibility = 'visible';
return false;
}
//continues same if statement for rest of the elements variables.
}
最初のifステートメントにのみ移動し、ループしません。