字符验证 [英] character validation

查看:75
本文介绍了字符验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

现在我正在创建登录页面...

所以在我的名字字段中我应该得到一个charcter值只有其他明智的它应该显示错误...

如何进行验证?....

发给我代码plzzzzzzzzz

now i am creating login page...
so in my name field i should get a charcter value only other wise it should be shows the error ...
how to do the validation ?....
send me the code plzzzzzzzzz

推荐答案

阅读的API文档JTextField 类显示了一个很好的例子

有条件地接受字符。如果你真的有冒险精神,可以看一下 JFormattedTextField 类进行更复杂的过滤。


亲切的问候,


Jos
Read the API docs for the JTextField class which shows a nice example
of conditionally accepting characters. If you''re feeling real adventurous have a
look at the JFormattedTextField class for more sophisticated filtering.

kind regards,

Jos


谢谢你,

但是现在我正在使用java脚本所以请告诉我java脚本中的解决方案....
thank you ,
but now i am using java scripts so tell me the solution in java scripts....


现在我正在创建登录页面...

所以在我的名字字段中我应该得到一个字符值,只有其他明智的应该是显示错误...

怎么做验证?....

发给我代码plzzzzzzzzz


- -------------------------------------------------- ----------------------------


和另一个是:

i我会得到一个像这样的字符串" hai; javascript"

但字符串应该在之前分成两个字符串; 作为一个字符串,然后; 作为另一个字符串...

这样清楚我的这两个doupts a尽快
now i am creating login page...
so in my name field i should get a charcter value only other wise it should be shows the error ...
how to do the validation ?....
send me the code plzzzzzzzzz

--------------------------------------------------------------------------------

and another one is :
i am going to get a string like this "hai;javascript"
but the string should be divided into two string in the sense before the ; takes as one string and after the ; takes as another string ..
so clear me my this two doupts as soon as possible


这篇关于字符验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆