对从属列表进行故障排除 [英] Troubleshooting Dependent Lists

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

问题描述

问候,


我有一个ASP页面,其中包含两个用JavaScript编写的动态依赖列表框。我的从属列表工作得很好,但我的问题是Program_Name的值。和Project_Name从上一页传递到此页面,我无法弄清楚如何在页面加载时显示列表框中传递的值。


在我添加下面的从属列表代码之前,所有变量都完美传递。目前,当页面加载时,Program_Name没有值。或Project_Name。但是,当我对EZWorkstream进行更改时,onChange事件会完全触发,然后值会出现在我的从属列表框中。


我远非JavaScript专家(下面我改编自Adobe.com的代码),所以这就是我所拥有的(我希望它不是太多):

Greetings,

I have an ASP page with two dynamic dependent list boxes written in JavaScript. My dependent lists work great, but my problem is that the values for "Program_Name" and "Project_Name" are passed onto this page from a previous page and I haven''t been able to figure out how to show the passed values in the list boxes when the page loads.

All variables passed perfectly before I added the dependent list code below. Currently, when the page loads, there are no values for "Program_Name" or "Project_Name". However, when I make a change to "EZWorkstream", the onChange events fire perfectly and values then appear in my dependent list boxes.

I''m far from an expert in JavaScript (the code below I adapted from Adobe.com), so here''s what I have (I hope it isn''t too much):

展开 | 选择 | Wrap | 行号

推荐答案

这些值是如何传递的?在URL?
How are these values passed? In the URL?


是。我使用名为ID的URL变量,它是记录的主键,将变量传递给新页面和记录集。
Yes. I use a URL variable called "ID", which is the primary key for the record, to pass the variables to the new page and recordsets.


如果我理解正确,列表已填充,但未设置值。那是对的吗?如果是这样,那么您需要做的就是设置与使用其value属性传递的值对应的选择列表的值,或者您可以使用ASP在页面加载期间设置这些值。
If I understand you correctly, the lists are populated, but the values are not set. Is that correct? If so, then all you need to do is set the value of the select lists corresponding to the values passed using its value property, or you could use ASP to set these values during page load.


这篇关于对从属列表进行故障排除的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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