jsp中判断的问题 - Java / Web 开发
怎样实现判断注册名在6到12位数之间
<script language="javascript">
function buy()
{
document.form1.submit();
}
function check()
{
if(document.form.regname.value=="")
{
alert("注册名不能为空");
document.form.regname.focus();
return false;
}
else if(document.form.realname.value=="")
{
alert("真实姓名不能为空");
document.form.realname.focus();
return false;
}
regname.value.length
我觉得你先要判断是否包含中文。
再使用length进行长度判断
这样写对吗
if(document.form.regname.value.lenght<6||document.form.regname.value.length>15)
{
alert("注册名填写错误");
document.form.regname.focus();
return false;
对的,其实还可以用正则表达式。
有汉字怎么办
if(document.form.regname.value.lenght<6||document.form.regname.value.length>15)
{
alert("注册名填写错误");
document.form.regname.focus();
return false;
相关问答:
为什么HTML以及一些其它标签会显示一些特定表现形式呢?如HTML中的换行标签<BR/>在底层是怎样实现的呢?现实的原理是什么呢
去W3C官方网站上,看看吧!我想一看你就明白了
我猜和编译原理有关,浏览器里可 ......
使用java在windows7 32位下连接MSSQL。
两台机器,windows7 32位,在控制面板里面全部设置语言和区域选项都english-unitedstates
唯一区别只有在安装SQL server 2008的时候 选择的字符集不一样,
exec sp_helpsor ......
我写了个jsp页面,然后改动了一下,改动的内容就是在jsp页面的js函数里加了个alert()语句,但是我访问这个页面时,死活都是原来页面的内容,我加了很多alert函数还是没改动前的页面内容;tomcat重启了,也重新部署这 ......
现在不想用<a> </a> 标签 ,因为点击后会出现页面重定位,给文字加上css样式就可以看起来 是href怎么实现这样的css
text-decoration:underline; cursor:hand;
引用
text-decoration:underline; cur ......