注册页面中的javascript问题

来源:百度知道 编辑:UC知道 时间:2024/05/21 14:20:44
以下是代码,validatesignup()的作用为在客户端验证输入数据的正确性(仅为部分)问题为:为什么在客户端不验证,不执行ALERT语句,直接进入SAVES.ASP呢?

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>注册</title>
<script language="javascript">
<!--
function validatesignup()
{
var strusername=document.form1.txtusername.value;
var strpassword=document.form1.txtpassword.value;
var strconfpassword=document.form1.txtconfpassword.value;
var strrealname=document.form1.txtrealname.value;
var strsex=document.form1.txtsex.value;
var strtel=document.form1.textel.value;
var stremail=document.form1.txtemail.value;
var strhomepage=document.form1.txthomepage.value;
var primeinusername=strusername.indexOf("'");
var primeinpassword=strpassword.indexOf("'");
var primeinstrconfpassword=strconfpasswo

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>注册</title>
<script language="javascript">
<!--
function validatesignup()
{
var strusername=document.form1.txtusername.value;
var strpassword=document.form1.txtpassword.value;
var strconfpassword=document.form1.txtconfpassword.value;
//var strrealname=document.form1.txtrealname.value;
//var strsex=document.form1.txtsex.value;
//var strtel=document.form1.textel.value;
//var stremail=document.form1.txtemail.value;
//var strhomepage=document.form1.txthomepage.value;
var primeinusername=strusername.indexOf("'");
var primeinpassword=strpassword.indexOf("'");
//var primeinstrconfpassword=strconfpassword.indexOf("'");
//var primeinrealname=strrealname.indexOf("'");