根据选择动态填充字段 [英] dynamic populating of fields based on selection

查看:79
本文介绍了根据选择动态填充字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好吧这是wat我试图做...我有一个带有选项A,B,P的列表字段现在我希望第二个列表字段显示数据列表,根据listbox1中的选择从数据库中获取它们。


例如,如果我在列表框1中选择A,则列表框2应自动显示状态为A的数据库中的所有数据。

并且当我更改seelction它应该相应地显示不同的数据。


但在我的代码中它不显示列表框2中的任何数据


plz help

ok this is wat i was trying to do...i have a list field with options A,B,P now i want the second list field to show data list by getting them from database based on the selection made in listbox1.

e.g if i select A in listbox 1 then listbox 2 should display automatically all the data from database where the status is A.
and as i change the seelction it should display different data accordingly.

but in my code it doesnt display any data in the listbox2

plz help

展开 | 选择 | Wrap | 行号

推荐答案

选项元素需要属性。这样,当您提交表单时,您将知道
Your option elements need a value attribute. That way, when you submit the form, you will know the value of the selected option in the


_POST 数组中所选选项的值。 />

表格:
_POST array.

Form:
展开 | 选择 | Wrap | 行号


确定这就是我改变了你所说的但是它的不是基于选择自动填充


请告诉我我需要更改哪一行nos。


thanx

ok this is what i changed as you said but its not auto populating based on selection

plz tell me what i need to change on which line nos.

thanx

展开 | 选择 | Wrap | 行号


这篇关于根据选择动态填充字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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