ajax 註冊頁面檢測效果二
function check_id(id_name,n){
var sd="lifont"+n;
obj = document.getElementById(''+sd+'');
var reId=/^[wu0391-uFFE5]+$/;
var b_id=reId.test(id_name);
if(!b_id){
obj.innerHTML="<li><div id=lifont>input data null</div></div> ";
//flag[1]=0;
//check_data();
}
else{
obj.innerHTML="<li><div id=lifont>Thank you ok</div></div>";
//checkid(id_name);
}
}
function number(num,n){
var sd="lifont"+n;
obj = document.getElementById(''+sd+'');
var renumber=/d{2,4}-d{7,8}|d{7,8}/;
var rn=renumber.test(num);
if(!rn){
obj.innerHTML="<li><div id=lifont>then number is error</div></div>";
}
else{
obj.innerHTML="<li><div id=lifont>thank you ok</div></div>";
}
}
function check_email(email,n){
var sd="lifont"+n;
obj = document.getElementById(''+sd+'');
var reEmail=/^w+([-+.]w+)*@w+([-.]w+)*.w+([-.]w+)*$/;
var b_email=reEmail.test(email);
if(b_email){
obj.innerHTML="<li><div id=lifont>Thank you email ok</div></div>";
}
else{
obj.innerHTML="<li><div id=lifont>input email error</div></div> ";
}
}
var code ;
function createCode()
{
code = "";
var codeLength = 6;
var checkCode = document.getElementById("code");
var selectChar = new Array(0,1,2,3,4,5,6,7,8,9,'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z');
for(var i=0;i<codeLength;i++)
{
var charIndex = Math.floor(Math.random()*36);
code +=selectChar[charIndex];
}
checkCode.innerHTML=code;
if(checkCode)
{
checkCode.className="code";
checkCode.value = code;
}
}
function show(sid)
{
var sd="salshow"+sid;
obj = document.getElementById(''+sd+'');
if(sid=="2")
{
var show=" <div id=title><div id=st>1</div></div><div class=thing onmouseOver=this.className='thingtwo' onmouseOut=this.className='thing'><a href=# onmouseover="document.getElementById('companyindustry').value ='Architect'">Architect</a></div><div id=title><div id=st>2</div></div><div class=thing class=thing onmouseOver=this.className='thingtwo' onmouseOut=this.className='thing'><a href=# onmouseover="document.getElementById('companyindustry').value ='Interior Designer'">Interior Designer</a></div><div id=title><div id=st>3</div></div><div class=thing class=thing onmouseOver=this.className='thingtwo' onmouseOut=this.className='thing'><a href=# onmouseover="document.getElementById('companyindustry').value ='Private Client'">Private Client </a></div><div id=title><div id=st>4</div></div><div class=thing class=thing onmouseOver=this.className='thingtwo' onmouseOut=this.className='thing'><a href=# onmouseover="document.getElementById('companyindustry').value ='Wholesaler'">Wholesaler</a> </div><div id=title><div id=st>5</div></div><div class=thing class=thing onmouseOver=this.className='thingtwo' onmouseOut=this.className='thing'><a href=# onmouseover="document.getElementById('companyindustry').value ='Importer'">Importer</a> </div>";
}
else{
var show="<div id=title><div id=st>1</div></div><div class=thing class=thing onmouseOver=this.className='thingtwo' onmouseOut=this.className='thing'><a href=# onmouseover="document.getElementById('salname').value ='Mr'">Mr</a></div><div id=title><div id=st>2</div></div><div class=thing class=thing onmouseOver=this.className='thingtwo' onmouseOut=this.className='thing'><a href=# onmouseover="document.getElementById('salname').value ='Mrs'">Mrs</a></div><div id=title><div id=st>3</div></div><div class=thing class=thing onmouseOver=this.className='thingtwo' onmouseOut=this.className='thing'><a href=# onmouseover="document.getElementById('salname').value ='Dr'">Dr</a></div> ";
}
obj.innerHTML = show;
}
function send(vid){
var sd="salshow"+vid;
obj = document.getElementById(''+sd+'');
obj.innerHTML ="";
}
function gocode ()
{
var er=document.getElementById("lifont9")
var inputCode = document.getElementById("inputcode").value;
// alert(code);
if(inputCode.length <=0)
{
// alert("please,input code value ");
er.innerHTML="<li><div id=lifont>please,input code value</div></li>";
}
else if(inputCode != code )
{
//alert("sorry,your input code error !");
er.innerHTML="<li><div id=lifont>sorry,your input code error !</div></li>";
createCode();//?
}
else
{
// alert("thank you input ok");
er.innerHTML="<li><div id=lifont>thank you input ok</div></li>";
}
}
function dotshow(){
obj = document.getElementById('noshow');
var show="<strong>ENTER</strong>";
obj.innerHTML = show;
MyWin.Create();
}
function Cl( objID )
{
var obj = document.getElementById( objID );
if( typeof( obj ) == 'object' )
obj.style.display = 'none';
}