ajax/php를 사용하여 폼 유효성 검사를 만들었습니다. 각 텍스트 상자는 다른 파일을 사용하여 확인됩니다. username_ajax.php. 정보가 확인 된 후에는 화면에 표시됩니다 ("사용자 이름 확인"). 모든 텍스트 상자가 '확인'되면 제출 버튼 만 누르는 방법을 알아낼 수 없습니다. 어떤 도움을 주셔서 감사합니다, 고마워.Ajax 양식 유효성 검사
내 코드 (죄송합니다 긴) : 모든 입력이 확인 될 때까지 비활성화에 제출 '버튼을 설정
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Sign-up</title>
</head>
<script type="text/javascript">
function username(username)
{
var httpRequest;
make_request()
function stateck()
{
if(httpxml.readyState==4)
{
document.getElementById ("user_div").innerHTML=httpxml.responseText;
}
}
httpxml.onreadystatechange=stateck;
user_url="ajax_username.php?username=" + username.value;
httpxml.open("GET",user_url,true);
httpxml.send(null);
}
function email(email)
{
var httpRequest;
make_request()
function stateck()
{
if(httpxml.readyState==4)
{
document.getElementById("email_div").innerHTML=httpxml.responseText;
}
}
httpxml.onreadystatechange=stateck;
email_url="ajax_email.php?value=" + email.value;
httpxml.open("GET",email_url,true);
httpxml.send(null);
}
function confirm(password,conpassword)
{
var httpRequest;
make_request()
function stateck()
{
if(httpxml.readyState==4)
{
document.getElementById("conpass_div").innerHTML=httpxml.responseText;
}
}
httpxml.onreadystatechange=stateck;
conpassword_url="ajax_password.php?password=" + password.value + "&conpassword=" + conpassword.value;
httpxml.open("GET",conpassword_url,true);
httpxml.send(null);
}
</script>
<body>
<div id="user_div"></div>
<div id="conpass_div"></div>
<div id="email_div"></div>
<form id="form" name="form" method="post" action="">
<label>Username<br />
<input type="text" name="username" id="username" onBlur="check_username(username)">
<br />
<br />
</label>
<label>Password<br />
<input type="password" name="password" id="password" onBlur="check_confirm (password,conpassword);">
</label>
<label><br />
<br />
Confirm Password<br />
<input type="password" name="conpassword" id="conpassword" onBlur="check_confirm(password,conpassword);">
<br />
<br />
</label>
<label>Email<br />
<input type="text" name="email" id="email" onblur="check_email(email)" />
<p>
<p>
<label>
<input type="submit" name="button" id="button" value="Submit" onclick="return false;" />
</label>
</p>
</form>
</body>
</html>
여기에 질문이 있습니까? –
모든 텍스트 상자가 '확인'되면 사용자가 제출 버튼 만 누를 수 있도록하는 방법을 이해할 수 없습니다. 예 .... 어떻게? – Elliott