<script language="javascript">
var xmlhttp ;
function findPwd()
{
window.status = '';
if(window.ActiveXObject){
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}else if(window.XMLHttpRequest){
xmlhttp=new XMLHttpRequest();
}
var url = "<%=basePath%>";
xmlhttp.onreadystatechange =getReady;
var callNumber = document.getElementById("username").value;
var logType = document.getElementsByName("logType");
var checkbox = document.getElementsByName("checkbox");
var verify = document.getElementById("verify").value;
var type;
var check;
var checkNum=0;
var checked = false;
for(var i =0;i<logType.length;i++){
if(logType[i].checked){
type = logType[i].value;
}
}
for(var i =0;i<checkbox.length;i++){
if(checkbox[i].checked){
checkNum=checkNum+1;
}
}
if(checkNum==1){
if(checkbox[0].checked){
check = "1a"
}else if(checkbox[1].checked){
check = "1b"
}
}else if(checkNum==2){
check="2"
}
url=url+"findPWServlet?username="+callNumber+"&logType="+type+"&check="+check+"&verify="+verify;
xmlhttp.open("GET",url);
xmlhttp.send(null);
}
function selectDisplay(){
var type;
var logType = document.getElementsByName("logType");
var checked = false;
for(var i =0;i<logType.length;i++){
if(logType[i].checked){
type = logType[i].value;
}
}
if(type == '2'|| type=='3'){
document.getElementById("aa").style.display='';
document.forms["findPWForm"]["logType"].value = type;
document.getElementById("logName").innerHTML = '手机号码';
}
}
function getReady()
{
if(xmlhttp.readyState == 4)
{ if(xmlhttp.status == 200)
{
var xmlReturn = xmlhttp.responseText;
if(xmlReturn == 'Y'){
alert("密码已发送,请注意查收");
}else if(xmlReturn == 'F'){
alert("您输入的验证码错误");
}else if(xmlReturn == 'W'){
alert("对不起,您输入的账号未注册");
}else if(xmlReturn == 'Z'){
alert("对不起,您输入的手机号未绑定");
}else if(xmlReturn == 'X'){
alert("对不起,您没有绑定邮箱");
}else{
alert("密码发送失败,请重试");
}
//document.getElementById("verify").innerText=xmlReturn;//验证码
}
xmlhttp = null;
}
} function logTypeSelect(logType, logName) {
if(logType == '2' || logType == '3'){
document.getElementById("aa").style.display='block';
}else { document.getElementById("aa").style.display='none';
}
document.forms["findPWForm"]["logType"].value = logType;
document.getElementById("logName").innerHTML = logName;
} function checkFindPWForm() {
var checked = false;
var len = document.findPWForm.checkbox.length;
if (document.forms["findPWForm"]["username"].value == '') {
alert("请输入账号");
document.forms["findPWForm"]["username"].focus();
return;
}
for (i = 0; i < len; i++)
{
if (document.findPWForm.checkbox[i].checked == true)
{
checked = true;
break;
}
}
if (!checked)
{
alert("请选择取回密码的方式");
return;
}
//document.forms["LoginForm2"]["k"].value = 1;
//alert();
// document.forms["findPWForm"].submit();
findPwd();
}</script>
var xmlhttp ;
function findPwd()
{
window.status = '';
if(window.ActiveXObject){
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}else if(window.XMLHttpRequest){
xmlhttp=new XMLHttpRequest();
}
var url = "<%=basePath%>";
xmlhttp.onreadystatechange =getReady;
var callNumber = document.getElementById("username").value;
var logType = document.getElementsByName("logType");
var checkbox = document.getElementsByName("checkbox");
var verify = document.getElementById("verify").value;
var type;
var check;
var checkNum=0;
var checked = false;
for(var i =0;i<logType.length;i++){
if(logType[i].checked){
type = logType[i].value;
}
}
for(var i =0;i<checkbox.length;i++){
if(checkbox[i].checked){
checkNum=checkNum+1;
}
}
if(checkNum==1){
if(checkbox[0].checked){
check = "1a"
}else if(checkbox[1].checked){
check = "1b"
}
}else if(checkNum==2){
check="2"
}
url=url+"findPWServlet?username="+callNumber+"&logType="+type+"&check="+check+"&verify="+verify;
xmlhttp.open("GET",url);
xmlhttp.send(null);
}
function selectDisplay(){
var type;
var logType = document.getElementsByName("logType");
var checked = false;
for(var i =0;i<logType.length;i++){
if(logType[i].checked){
type = logType[i].value;
}
}
if(type == '2'|| type=='3'){
document.getElementById("aa").style.display='';
document.forms["findPWForm"]["logType"].value = type;
document.getElementById("logName").innerHTML = '手机号码';
}
}
function getReady()
{
if(xmlhttp.readyState == 4)
{ if(xmlhttp.status == 200)
{
var xmlReturn = xmlhttp.responseText;
if(xmlReturn == 'Y'){
alert("密码已发送,请注意查收");
}else if(xmlReturn == 'F'){
alert("您输入的验证码错误");
}else if(xmlReturn == 'W'){
alert("对不起,您输入的账号未注册");
}else if(xmlReturn == 'Z'){
alert("对不起,您输入的手机号未绑定");
}else if(xmlReturn == 'X'){
alert("对不起,您没有绑定邮箱");
}else{
alert("密码发送失败,请重试");
}
//document.getElementById("verify").innerText=xmlReturn;//验证码
}
xmlhttp = null;
}
} function logTypeSelect(logType, logName) {
if(logType == '2' || logType == '3'){
document.getElementById("aa").style.display='block';
}else { document.getElementById("aa").style.display='none';
}
document.forms["findPWForm"]["logType"].value = logType;
document.getElementById("logName").innerHTML = logName;
} function checkFindPWForm() {
var checked = false;
var len = document.findPWForm.checkbox.length;
if (document.forms["findPWForm"]["username"].value == '') {
alert("请输入账号");
document.forms["findPWForm"]["username"].focus();
return;
}
for (i = 0; i < len; i++)
{
if (document.findPWForm.checkbox[i].checked == true)
{
checked = true;
break;
}
}
if (!checked)
{
alert("请选择取回密码的方式");
return;
}
//document.forms["LoginForm2"]["k"].value = 1;
//alert();
// document.forms["findPWForm"].submit();
findPwd();
}</script>
if(window.ActiveXObject){
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}else if(window.XMLHttpRequest){
xmlhttp=new XMLHttpRequest();
} 换下顺序看看,前一个if是判断ie6浏览器的,后一个是else if是判断火狐和ie7浏览器的,这两个浏览器自带XMLHttpRequest对象。if(window.XMLHttpRequest)
{
xmlhttp=new XMLHttpRequest();
if(xmlhttp.overrideMimeType)
{
xmlhttp.overrideMimeType("text/xml")
}
}
else if(window.ActiveXObject)
{
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
浏览器处理不一样
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}else if(window.XMLHttpRequest){//非IE
xmlhttp=new XMLHttpRequest();
}