如何用javascript判断用户填写注册信息是否完整?

huguang 2004-03-22 12:08:52
我是菜鸟!
最好能给个简单的实例!
谢谢各位!!!
...全文
214 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
alphaltx 2004-03-22
  • 打赏
  • 举报
回复
<script language="javascript">
function change() {
if (form1.text1.value==""){
alert("用户名不能为空!");
form1.text1.focus();
}else{
form1.sumbit;
}
}
</script>

<form action="xxxx" name="form1" method="post">
<input type=text name="text1" id="text1">
<input type="button" onClick="change();" value="提交">
</form>
lxyy_1118 2004-03-22
  • 打赏
  • 举报
回复
<script language="javascript">
function change() {
function check()
{
if (form1.text1.value=="")
{alert("用户名不能为空!");
return true;
}
else return false;
}
</script>
<form action="xxx.asp" name="form1" method="post" onsubmit="return check();">
<input type=text name="text1">
<input type="submit" name="button1" value="提交">
</form>
vvfish119 2004-03-22
  • 打赏
  • 举报
回复
<script language="javascript">
function change() {
if (form1.text1.value=="")
{alert("用户名不能为空!");}
else{form1.sumbit;}
}
</script>
<form action="#" name="form1" method="post">
<input type=text name="text1">
<input type="button" onClick="change();" value="提交">
</form>

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧