服务器控件按钮验证方法

 

None.gif     function checkdata()
ExpandedBlockStart.gifContractedBlock.gif            
dot.gif {
InBlock.gif                
if(document.getElementById("TB_UserName").value=="" )
ExpandedSubBlockStart.gifContractedSubBlock.gif                
dot.gif{
InBlock.gif                    alert(
"注册帐号不能为空"); 
InBlock.gif                    
return false;
ExpandedSubBlockEnd.gif                }

InBlock.gif                
InBlock.gif                
if(document.getElementById("TB_PassWord").value=="" )
ExpandedSubBlockStart.gifContractedSubBlock.gif                
dot.gif{
InBlock.gif                    alert(
"用户密码不能为空"); 
InBlock.gif                    
return false;
ExpandedSubBlockEnd.gif                }

InBlock.gif                
if(document.getElementById("TB_Password2").value=="" )
ExpandedSubBlockStart.gifContractedSubBlock.gif                
dot.gif{
InBlock.gif                    alert(
"密码确认不能为空"); 
InBlock.gif                    
return false;
ExpandedSubBlockEnd.gif                }

InBlock.gif                
if(document.getElementById("TB_Password2").value!=document.getElementById("TB_PassWord").value )
ExpandedSubBlockStart.gifContractedSubBlock.gif                
dot.gif{
InBlock.gif                    alert(
"用户密码与密码确认不一致!"); 
InBlock.gif                    
return false;
ExpandedSubBlockEnd.gif                }

InBlock.gif                
if(document.getElementById("TB_Name").value=="" )
ExpandedSubBlockStart.gifContractedSubBlock.gif                
dot.gif{
InBlock.gif                    alert(
"真实姓名不能为空"); 
InBlock.gif                    
return false;
ExpandedSubBlockEnd.gif                }

InBlock.gif                
InBlock.gif                
InBlock.gif                
if(document.getElementById("TB_Email").value=="" )
ExpandedSubBlockStart.gifContractedSubBlock.gif                
dot.gif{
InBlock.gif                    alert(
"电子信箱不能为空"); 
InBlock.gif                    
return false;
ExpandedSubBlockEnd.gif                }

InBlock.gif                
else
ExpandedSubBlockStart.gifContractedSubBlock.gif                
dot.gif{
InBlock.gif                    
//验证电子信箱            
InBlock.gif
                    
ExpandedSubBlockStart.gifContractedSubBlock.gif                    var re
=/^\w+@\w+\.\wdot.gif{2,3}/;
InBlock.gif                    var str
=document.getElementById("TB_Email").value;
InBlock.gif                    var r
=str.match(re);
InBlock.gif                    
if(r==null)
ExpandedSubBlockStart.gifContractedSubBlock.gif                    
dot.gif{
InBlock.gif                        alert(
"邮箱可以帮你找回密码,请认真填写"); 
InBlock.gif                        
return false;
ExpandedSubBlockEnd.gif                    }

ExpandedSubBlockEnd.gif                }

InBlock.gif                
if(document.getElementById("TB_Birthday").value=="" )
ExpandedSubBlockStart.gifContractedSubBlock.gif                
dot.gif{
InBlock.gif                    alert(
"出生日期不能为空"); 
InBlock.gif                    
return false;
ExpandedSubBlockEnd.gif                }

InBlock.gif                
else
ExpandedSubBlockStart.gifContractedSubBlock.gif                
dot.gif{
ExpandedSubBlockStart.gifContractedSubBlock.gif                    var re
=/^\ddot.gif{4}-\ddot.gif{1,2}-\ddot.gif{1,2}$/;
InBlock.gif                    var str
=document.getElementById("TB_Birthday").value;
InBlock.gif                    var r
=str.match(re);
InBlock.gif                    
if(r==null)
ExpandedSubBlockStart.gifContractedSubBlock.gif                    
dot.gif{
InBlock.gif                        alert(
"注意日期格式:1980-01-01"); 
InBlock.gif                         
return false;
ExpandedSubBlockEnd.gif                    }
    
ExpandedSubBlockEnd.gif                }

InBlock.gif                
return true;
ExpandedBlockEnd.gif            }

function Eventbody() { document.all("Btn_Post").attachEvent('onclick',checkdata) }
这个是body 的 οnlοad=" Eventbody()" 事件
给服务器控件按钮Btn_Post添加一个事件

转载于:https://www.cnblogs.com/discoverx/archive/2007/05/22/755708.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值