根据预加载的下拉列表项验证文本框输入 [英] Validating textbox input against pre-loaded dropdownlist items

查看:64
本文介绍了根据预加载的下拉列表项验证文本框输入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何检查文本框中输入的日期是否在预先加载(从数据库)到下拉列表的日期范围内,而不必查询数据库? 

How do I check if the date entered in a text box is in the range of dates that have been pre-loaded (from a database) into the drop down list without having to query the DB? 

每个客户ID都有一些加载到下拉列表中的日期集合。 我必须添加一个文本框,让用户输入日期以显示其帐户信息。 现在我必须确保客户在文本框中输入的日期
位于下拉列表中的集合中。 如果它不在列表中,如何将其默认为列表中的第一个上一个日期? 

Each individual client ID has a certain collection of dates that are loaded into a dropdownlist.  I had to add a textbox to let the user enter a date to show their account info.  Now I have to make sure the date the client enters in the textbox is in the collection in the dropdownlist.  If it's not in the list, how do I make it default to the first previous date on the list? 

感谢任何人的帮助!

推荐答案

如果日期已经在(我假设组合框?),那么迭代组合框项目。
If the dates are already in the (I assume combobox?), then iterate through the combobox items.


这篇关于根据预加载的下拉列表项验证文本框输入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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