注册不能为空的代码

来源:百度知道 编辑:UC知道 时间:2024/04/28 05:01:55
怎样才可以让下面的注册顶提示不能为空
谢谢

<html>
<head>
<title>无标题文档</title>
</head>

<body>
<table width="456" border="0" align="center">
<tr>
<td colspan="5"><form name="form1" method="post" action="login.asp">
<table width="446" border="1">
<tr>
<td width="59"> </td>
<td colspan="4"> </td>
</tr>
<tr>
<td>用户名:</td>
<td colspan="4"><input type="text" name="textfield"></td>
</tr>
<tr>
<td>密码:</td>
<td colspan="4"><input type="password" name=&q

<html>
<head>
<title>无标题文档</title>
<script type="text/javascript" language="javascript">
function checksubmit(form){
if(form.username.value.length == 0){
alert("用户名不能为空");
return false;
}
if(form.userpwd.value.length == 0){
alert("用密码不能为空");
return false;
}
}
</script>
</head>
<body>
<table width="456" border="0" align="center">
<tr>
<td colspan="5"><form name="form1" method="post" action="login.asp" onsubmit="return checksubmit(this);">
<table width="446" border="1">
<tr>
<td width="59"> </td>
<td colspan="4"> </td>
</tr>
<tr>
<td>用户名:</td> <