无法填写下拉列表 [英] Cannot fill dropdown list

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

问题描述

你好,

我有2个下拉列表.第一个填充有数据库中的记录.

我必须根据第一个下拉列表中的选择填写第二个下拉列表.这意味着我必须获取第一个下拉列表的选定值,并将其保存在变量中.然后执行查询以使用该变量中的值填充第二个下拉列表.

我需要在没有提交"按钮的情况下执行此操作.选择第一个下拉列表后,必须填写第二个下拉列表.

问题是如何填写第二个下拉列表?

有什么想法吗?

Hello,

I have 2 dropdown list. The first one is filled with records from the database.

I have to fill the 2nd dropdown list according to the selection in the 1st dropdown list. This means that I have to get the selected value of the 1st dropdown list and have to save this in a variable. Then execute a query to fill the 2nd dropdown list using the value in that variable.

I need to do this without a Submit button. Upon the selection of 1st dropdown list, the 2nd dropdown list has to be filled.

The question is How can I fill the 2nd dropdown list ?

Any ideas ?

推荐答案

您自己尝试了什么?在Google上搜索"Javascript将项目添加到下拉列表"之类的内容,然后看看会发生什么.这很简单,不需要太多研究.您应该在寻找AJAX/PHP示例和javascript填充下拉列表.我敢肯定,如果您花几分钟的时间进行搜索,就会在网上找到此类示例-我知道我过去曾经为C#找到了一些不错的示例:)

Ed
Tried anything yourself? Search Google for ''Javascript Add item to Drop Down List'' or something and see what comes up. This is simple and does not need much research. You should be looking for AJAX/PHP examples and javascript filling drop downs. I am sure you will find examples of this on the web already if you just spend a few minutes searching - I know I found some good ones for C# in the past :)

Ed


这篇关于无法填写下拉列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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