两个下拉列表比较相同的值 [英] two dropdownlist compare same values

查看:120
本文介绍了两个下拉列表比较相同的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
我的要求是.
我有两个dropdownlist firt dropdownlist名称是ddlstockname,第二个是ddldepartmentname
假设我第一次在ddlstockname中选择的是"papers",而第一次选择ddldepartmenname是
实验室".第二次,如果我选择相同的论文"和实验室",我想显示一个消息框,例如已经赋予该股票名称的
实验室"部门.如果ddlstocknaem选择文件",然后选择另一个ddldepartmentname,就可以了.
请发给我 . Thankyou.

hi all,
my requirement is.
I have two dropdownlist firt dropdownlist name is ddlstockname and second one is ddldepartmentname
suppose first time i selected in ddlstockname is "papers" and first time selected ddldepartmenname is
"lab" . second time if i select same "papers" and "lab" i want display one message box like this stockname already given to
"lab" department. if ddlstocknaem select "papers" and select another ddldepartmentname it''s ok.
please send me . thankyou.

推荐答案

请给我
什么代码? 在这里不能这样工作.

这是询问者的期望:
1. 先尝试您要做什么!您可能会发现它并不难.
2.制定看起来像问题/无法解决的问题.

试试看,告诉他们是否遇到问题.



目前,您所寻求的是从服务器端进行验证,如果之前选择了下拉菜单中的特定值.为了获得良好的用户体验,您需要使用Javascript.使用Javascript与服务器对话,如果已预先选择响应,则返回响应.

步骤:
1.通过更改下拉值来提高JS方法
2.将当前选定的项目ID传递给Javascript方法
3.将XMLHttpRequest或Callback发送到服务器以对当前选定的项目ID进行响应
4.根据响应显示消息.

现在,尝试一下,如果您遇到问题,则发布特定的问题.
please send me
What code? It does not work like this here.

Here is what is expected of enquirers:
1. TRY first what you want to do! You may find that it''s not that hard.
2. Formulate what was done by you that looks like an issue/not working.

Try them and tell if you face issues.



For now, what you seek is validation from server side if a particular value in dropdown was selected earlier. To do it with good user experience, you need to use Javascript. Talk to server using Javascript and get back the response if it was preselected.

Steps:
1. raise a JS method on change of dropdown value
2. pass on the current selected item id to Javascript method
3. send a XMLHttpRequest or Callback to server for response on the current selected item id
4. based on the response show the message.

Now, try out, post specific issue if you face.


这篇关于两个下拉列表比较相同的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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