如何使用Jquery添加下拉列表和文本框 [英] How to add dropdownlist and textbox using Jquery

查看:85
本文介绍了如何使用Jquery添加下拉列表和文本框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好我有一个从数据库填充的下拉列表现在任务是我需要添加下拉列表,其值除了在第一个下拉列表中选择的值之外该怎么做?

Hi I have a dropdownlist which is populated from database now the task is I need to add dropdownlist with same the values except the value that is selected in the first dropdown how to do it?

推荐答案

如果您正在使用C#,那么您可以编写第一个下拉列表的类似LINQ查询OnSelectionChanged / OnChange事件。

示例如下所示。

If you are using C#, then you can write similar LINQ query OnSelectionChanged/OnChange event of 1st dropdown.
Sample is shown below.
string selectedValue = "Peeter";
 var emplst = from e in empList
 where e.Name != selectedValue
 select new { e.Name };





如果您使用的是不同的语言/框架。 ..分享您将使用的示例代码,以便我们可以提供更好的帮助。



谢谢。



If you are using different language/framework...share sample code which you would be using, so that we can help better.

Thanks.


这篇关于如何使用Jquery添加下拉列表和文本框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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