0
당신의 도움이 필요합니다. 나는 이해할 수없는 아주 간단한 문제가 있습니다. 설명하기가 어렵지만 한 줄에 의견이 있으며 이해할 수 있기를 바랍니다. 여기 내 코드가있다. 긴 게시물을 위해 유감스럽게 생각하지만 나는이 구멍에서 빠져 나가는 것 같다. 어딘가에 몸에document.getElementById ("ID"). 값이 작동하지 않습니다.
function CheckLength()
{
var stringpassword = document.getElementById('Pass').value;
alert(document.getElementById('Pass').value); --> this part is only printing a blank.
/*
if(document.getElementById("Pass").value.length > 8)
{
return true;
}
else
{
alert(document.getElementById("Pass").value.length);
return false;
}
*/
}
function Check(a)
{
switch(a)
{
case 1 :
var first = document.getElementById("Uname").value.toUpperCase().indexOf(document.getElementById("Fname").value.toUpperCase());
var last = document.getElementById("Uname").value.toUpperCase().indexOf(document.getElementById("Lname").value.toUpperCase());
if(first !=-1 || last != -1)
{
alert("huy mali ang username. bawal yan pre");
document.getElementById("Uname").value = "";
}
break;
case 2 :
var gate = 0;
var first = document.getElementById("Pass").value.toUpperCase().indexOf(document.getElementById("Fname").value.toUpperCase());
var last = document.getElementById("Pass").value.toUpperCase().indexOf(document.getElementById("Lname").value.toUpperCase());
if(first !=-1 || last != -1)
{
alert("mali dahil sa name");
gate++;
}
if(!CorrectPassword())
{
gate++;
}
if(!CheckLength())
{
gate++;
}
if(gate != 0)
{
alert("Please follow password policy");
document.getElementById("Pass").value="";
}
break;
case 3:
if(document.getElementById("Pass").value != document.getElementById("Rpass").value)
{
document.getElementById("Rpass").value = "";
}
break;
}
}
:
<input type="Password" placeholder="Password" value="" id="Pass" onblur="Check(2)"/>
을하지만 난 그것을 시도 할 때. 암호 필드에 입력 한 후 clickng somehwere else. 경고 상자는 빈 경고 상자 만 반환합니다. 심지어 간단한 할당 문이 작동하지 않습니다? 내 나쁜 영국에 대한 나를 용서