如何限制用户仅使用文本框达到限制 [英] How do I restrict user to use textbox only upto a limit

查看:130
本文介绍了如何限制用户仅使用文本框达到限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望用户使用文本框达到限制,之后文本框应该被禁用,例如,
。如果用户只想输入3个客户的信息,那么输入3个值后该文本框将被禁用

I want a user to use a textbox upto a limit and after that text box should get disabled,
for eg. If a user wants to enter information of only 3 customers then that textbox should get disabled after entering 3 values

推荐答案

这不完全正确。如果您要在nox中提供免费文本输入,则无法准确检测框中输入的客户数量。



如果这些客户是从数据库中选择,提供列表视图而不是下拉列表,以便用户可以直接选择客户。



或者,只需提供三个文本框 maxlength [ ^ ],以便用户输入限制长度的名称。
This is not exactly right. If you are going to provide free text entry in the nox, there is no way to accurately detect how many customers were entered in the box.

If these customers are to be selected from a database, provide a list view rather than a drop down so that user can select customers directly.

Alternately, just provide three text boxes with maxlength[^] defined on each so that user enters names with restricted length.


Hello abhinav,感谢您的回复。但请理解我的问题。我正在设计一个飞行管理项目,当我的用户选择他所选择的乘客时。然后,如果选择乘客数量为3,则只允许他输入3个客户的信息。语言:-C#
Hello abhinav, Thanks for your reply . But please understand my question . I am designing a flight management project , In that when my user selects no.of passengers of his choice. Then he should be only allowed to enter information of 3 customers if selects no.of passengers as 3. Language :-C#


是否允许用户在文本框中输入客户详细信息使用任何分隔符?

如果是,则使用下面的代码禁用文本框。



Do you want to allow user to enter customer details in the text box with any separator?
If yes then use below code to disable text box.


这篇关于如何限制用户仅使用文本框达到限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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